Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Sunday, March 11, 2012

COM object with CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} is either not valid or not re

Hello,

I have a asp.net application that calls a DTS package. This application is running fine on my machine (where SQL Server and Web Server are running). When I moved the application to a Web Server (where SQL Server is not installed), I am getting the following error due to the DTS package.

COM object with CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} is either not valid or not registered.

I tried every thing I could find on the web but with no luck.

Can someone please help me?
Many thanks in advance for your help.

A COM error means that something was not registered, so I am guessing the product SQL 2005 or DTS part was not installed in that computer, did you try to reinstall SQL 2005?|||

Your error is explained in the link below and I know the plain way to deploy DTS so if you decide to change your means of deployment post again so I can help. Hope this helps.

http://www.velocityreviews.com/forums/t93159-com-object-with-clsid-10020200eb1c11cfae6e00aa004a34d5-is-either-not-valid-or-not-registered.html

|||

Hiya guys.

Sorry for the late update!!!

Special thanks to Caddre!

Just want to give an update on this issue.
Basically, I have never been able to manage to sort this one out, despite viewing many articles on the net.

However, I just want to share one option to overcome this problem.

You can invoke your DTS package through a JOB using SP_START_JOB stored proc. This SP Instructs SQL Server Agent to execute a job immediately. This would do the job of executing the package!!! Of course, you will need the right to run the job (or use impersonation).

Hope this helps.

COM Interops on MTA's...

Greetings!
I'm trying to use the SQLXML BulkLoad COM object from a .net multithreaded
application... I'm currently getting an error when I try to use this object
saying:
System.InvalidCastException: Unable to cast COM object of type
'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class' to interface type
'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
at SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class.set_ConnectionString(String
pbstrConnectionString)
at Olympus.Integrate.Client.SqlServerClient.SendMessage(String message)
in C:\Projects\prototype\Integrate\SqlServe
rClient\SqlServerClient.vb:line
62
at Olympus.Integrate.Core.Core.MonitorFlow(Object flowObj) in
C:\Projects\prototype\Integrate\Integrat
e\Core.vb:line 152
Now I'm guessing that this COM object does support multiple threads.
So the question is how to get around this. Would wrapping this function in a
singleton, for example, do the trick? Or maybe having a static function in
an object?
What would be the best approach?
thanks for your time.
Daniel."Daniel Bass" <danREMOVEbass@.blueCAPSbottle.comFIRST> wrote in message
news:OC2INWwwHHA.1164@.TK2MSFTNGP02.phx.gbl...
> Greetings!
> I'm trying to use the SQLXML BulkLoad COM object from a .net multithreaded
> application... I'm currently getting an error when I try to use this
> object saying:
> System.InvalidCastException: Unable to cast COM object of type
> 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class' to interface type
> 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation failed because the
> QueryInterface call on the COM component for the interface with IID
> '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following
> error: No such interface supported (Exception from HRESULT: 0x80004002
> (E_NOINTERFACE)).
> at SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class.set_ConnectionString(String
> pbstrConnectionString)
> at Olympus.Integrate.Client.SqlServerClient.SendMessage(String message)
> in C:\Projects\prototype\Integrate\SqlServe
rClient\SqlServerClient.vb:line
> 62
> at Olympus.Integrate.Core.Core.MonitorFlow(Object flowObj) in
> C:\Projects\prototype\Integrate\Integrat
e\Core.vb:line 152
>
> Now I'm guessing that this COM object does support multiple threads.
> So the question is how to get around this. Would wrapping this function in
> a singleton, for example, do the trick? Or maybe having a static function
> in an object?
> What would be the best approach?
> thanks for your time.
> Daniel.
Make sure your thread is initilaize to enter a STA before starting (see
SetApartmentState(ApartmentState.STA) in System.Threading).
Willy.

>|||Willy,
Thanks for your reply.
In my application I dynamically create multiple threads according to some
configuration. At this point in the application the knowledge doesn't exist
as to whether the thread that is created will use the COM object... Is it
recommended that I just mark each thread as STA?
For Each myObj As MyObjectType In myObjects
' launch a seperate thread for each configured message flow
Dim t As Thread = New Thread(AddressOf MyThreadStartFunction)
t.Name = myObj.myName
t.SetApartmentState(ApartmentState.STA) // <-- ' Is
this okay '
MyThreadHandler.Instance.AddThread(t)
t.Start(myParameter)
Next
Cheers.
Dan.|||"Daniel Bass" <danREMOVEbass@.blueCAPSbottle.comFIRST> wrote in message
news:e1UxaY5wHHA.1184@.TK2MSFTNGP04.phx.gbl...
> Willy,
> Thanks for your reply.
> In my application I dynamically create multiple threads according to some
> configuration. At this point in the application the knowledge doesn't
> exist as to whether the thread that is created will use the COM object...
> Is it recommended that I just mark each thread as STA?
> For Each myObj As MyObjectType In myObjects
> ' launch a seperate thread for each configured message flow
> Dim t As Thread = New Thread(AddressOf MyThreadStartFunction)
> t.Name = myObj.myName
> t.SetApartmentState(ApartmentState.STA) // <-- ' Is
> this okay '
> MyThreadHandler.Instance.AddThread(t)
> t.Start(myParameter)
> Next
> Cheers.
> Dan.
>
Dan, The apartment state is a COM only thing, it doesn't affect .NET. An STA
apartment is valid for single and apartment threaded COM object types, so in
your case it is safe to initialize your threads to enter an STA .
Willy.|||"Willy Denoyette [MVP]" <willy.denoyette@.telenet.be> wrote in message
news:uj0Wdq7wHHA.4592@.TK2MSFTNGP05.phx.gbl...
> "Daniel Bass" <danREMOVEbass@.blueCAPSbottle.comFIRST> wrote in message
> news:e1UxaY5wHHA.1184@.TK2MSFTNGP04.phx.gbl...
> Dan, The apartment state is a COM only thing, it doesn't affect .NET. An
> STA apartment is valid for single and apartment threaded COM object types,
> so in your case it is safe to initialize your threads to enter an STA .
> Willy.
>
Thanks. I keep getting a ContextSwtichDeadlock, but reading up it sounds
like a bogus message. My process spends a lot of time looping around in
other parts of the code while polling which suggests the reason for this
error coming up.
Thanks for your help.
Dan.|||"Daniel Bass" <danREMOVEbass@.blueCAPSbottle.comFIRST> wrote in message
news:OiEYjv7wHHA.3444@.TK2MSFTNGP05.phx.gbl...
> "Willy Denoyette [MVP]" <willy.denoyette@.telenet.be> wrote in message
> news:uj0Wdq7wHHA.4592@.TK2MSFTNGP05.phx.gbl...
> Thanks. I keep getting a ContextSwtichDeadlock, but reading up it sounds
> like a bogus message. My process spends a lot of time looping around in
> other parts of the code while polling which suggests the reason for this
> error coming up.
> Thanks for your help.
> Dan.
>
This is not necessarily bogus message, don't take this too lightly. One
possible reason for the MDA is that your thread fails to pump the message
queue, if that's the case you will have problems whenever the finalizer
needs to release the COM object references you are holding in this thread,
this will block the finalizer thread with as a result that finalizable
objects stay in memory, finally leading into OOM and other kind of failures.
Willy.|||>> Thanks. I keep getting a ContextSwtichDeadlock, but reading up it sounds
> This is not necessarily bogus message, don't take this too lightly. One
> possible reason for the MDA is that your thread fails to pump the message
> queue, if that's the case you will have problems whenever the finalizer
> needs to release the COM object references you are holding in this thread,
> this will block the finalizer thread with as a result that finalizable
> objects stay in memory, finally leading into OOM and other kind of
> failures.
> Willy.
>
I've kept the process running, keeping an eye on memory and handles, and it
appears to destory and release the COM object correctly as there's no
increase in the resources used.
How would I check whether I'm "failing to pump the message queue"? This is
not a GUI app, but a backend service. Is there any way in .Net to check the
COM reference count?
I do explicitly disgard the object after creating and using...
' clear up
System.Runtime.InteropServices.Marshal.ReleaseComObject(bulkLoadComObject)
bulkLoadComObject = Nothing
Thanks.
Daniel.

Columns to Rows

Lets say I have the following rows..

ID,Net,Gross,Total
1 ,25.00,55.00,100.00
2,35.00,65.00,250.00

What would be the best way to do this...

ID, Description, Value
1, Net, 25.00
1, Gross,55.00
1, Total, 100,00
2, Net 35,00

I was using the multicast and doing a bunch of derived columns but it seems like there should be a eaiser way to do this.

Any help would be appreciated, thanks.

Mardo

Read up on the unpivot transform in BOL. I believe this should be able to do what you want.

HTH,

Matt

Wednesday, March 7, 2012

Column widths are changing when deploying report

I designed a report in VS.Net 2003. It was actually an existing RDL file
that I just modified for my new report, adding some columns and doing various
formatting things.
In VS when I look at the report design, I have the report at 8.5 in high by
11 in wide with .25 in margins all around. I have 2 columns on the right
side of the table that, when deployed and viewed in PDF, are wider than the
width I defined for the column. For all cells in the columns Can Grow is
false. I have tried moving things all over the place but it won't affect
these two columns, they always stay as wide as they are each time.CanGrow only applies to vertical sizes, not horizontal sizes. The only
things that will grow horizontally are matrices and sized images. Do you
have any images?
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"AdamB" <AdamB@.discussions.microsoft.com> wrote in message
news:1E9C6385-B0D0-44DC-95D8-B0317A3F07A5@.microsoft.com...
>I designed a report in VS.Net 2003. It was actually an existing RDL file
> that I just modified for my new report, adding some columns and doing
> various
> formatting things.
> In VS when I look at the report design, I have the report at 8.5 in high
> by
> 11 in wide with .25 in margins all around. I have 2 columns on the right
> side of the table that, when deployed and viewed in PDF, are wider than
> the
> width I defined for the column. For all cells in the columns Can Grow is
> false. I have tried moving things all over the place but it won't affect
> these two columns, they always stay as wide as they are each time.|||No, but I seem to have resolved the problem by deleting then recreating the
columns
"Brian Welcker [MS]" wrote:
> CanGrow only applies to vertical sizes, not horizontal sizes. The only
> things that will grow horizontally are matrices and sized images. Do you
> have any images?
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "AdamB" <AdamB@.discussions.microsoft.com> wrote in message
> news:1E9C6385-B0D0-44DC-95D8-B0317A3F07A5@.microsoft.com...
> >I designed a report in VS.Net 2003. It was actually an existing RDL file
> > that I just modified for my new report, adding some columns and doing
> > various
> > formatting things.
> >
> > In VS when I look at the report design, I have the report at 8.5 in high
> > by
> > 11 in wide with .25 in margins all around. I have 2 columns on the right
> > side of the table that, when deployed and viewed in PDF, are wider than
> > the
> > width I defined for the column. For all cells in the columns Can Grow is
> > false. I have tried moving things all over the place but it won't affect
> > these two columns, they always stay as wide as they are each time.
>
>

Saturday, February 25, 2012

column names of the table

Hi guys,

Is there any function that can the column names of the table? I know about the sp_help but I want I'm going to call this from my .net application?

Thanks

How about using the INFORMATION_SCHEMA.COLUMNS view? -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog: http://solidqualitylearning.com/blogs/tibor/ wrote in message news:2ff402f1-91fb-4795-aee4-bc05d3efcffa@.discussions.microsoft.com...
> Hi guys, >
> Is there any function that can the column names of the table? I know
> about the sp_help but I want I'm going to call this from my .net
> application? > > >
> Thanks >
>|||try this
select column_name from information_schema.columns where table_name ='agents'|||Thank guys!!!

Sunday, February 19, 2012

Column does not allow nulls

Hi,

This should be straight forward, but I've searched high and low on the net.

I have a FORM which allows me to INSERT data, SQL Server 2005 backend. I populate the all the mandatory fields.

But when I click on the Insert button, it won't let me save and says:

Column 'PERSONAL_ID' does not allow nulls

I'musing tableadapters, business logic layers etc. and pausing clearlyshows that the values from the form are being passed to the procedurethat I have created "AddNewRecord". And PERSONAL_ID is definitely notNULL!

It fails on

Line 971: Me.Rows.Add(row)

PERSONAL_IDis a primary key which I generate. The pause also shows that forPERSONAL_ID it says" {"Conversion from type 'DBNull' to type 'String'is not valid."}

Function AddNewRecord looks like this:

<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, True)> _
Public FunctionAddNewRecord(ByVal PERSONAL_ID As String, ByVal SURNAMEAs String, ByVal CHRISTIAN_NAME As String, ByVal SEX As String, _
ByVal FAMILY_POSITION As String, ByVal FAMILY_ID As String, ByValADDRESS_1 As String, ByVal ADDRESS_2 As String, _
ByVal ADDRESS_3As String, ByVal ADDRESS_4 As String, ByVal ADDRESS_5 As String, ByValADDRESS_6 As String, ByVal POSTCODE As String, ByVal COUNTRY As String,ByVal ORG_ID As String) As Boolean
' create a new details row instance
Dim details As New smDetails.smTbl_DetailsIDDataTable
Dim detail As smDetails.smTbl_DetailsIDRow = details.NewsmTbl_DetailsIDRow

details.AddsmTbl_DetailsIDRow(detail)
.
.
.
my formview code is this:

<InsertItemTemplate>
PERSONAL_ID:
<asp:TextBox ID="PERSONAL_IDTextBox" runat="server"
Text='<%# Bind("PERSONAL_ID") %>' AutoPostBack="True" />
<br />
SURNAME:
<asp:TextBox ID="SURNAMETextBox" runat="server" Text='<%# Bind("SURNAME") %>'
AutoPostBack="True" />
<br />
CHRISTIAN_NAME:
<asp:TextBox ID="CHRISTIAN_NAMETextBox" runat="server"
Text='<%# Bind("CHRISTIAN_NAME") %>' />
<br />
SEX:
<asp:TextBox ID="SEXTextBox" runat="server" Text='<%# Bind("SEX") %>' />
<br />
FAMILY_POSITION:
<asp:TextBox ID="FAMILY_POSITIONTextBox" runat="server"
Text='<%# Bind("FAMILY_POSITION") %>' />
<br />
FAMILY_ID:
<asp:TextBox ID="FAMILY_IDTextBox" runat="server"
Text='<%# Bind("FAMILY_ID") %>' />
<br />
ADDRESS_1:
<asp:TextBox ID="ADDRESS_1TextBox" runat="server"
Text='<%# Bind("ADDRESS_1") %>' />
<br />
ADDRESS_2:
<asp:TextBox ID="ADDRESS_2TextBox" runat="server"
Text='<%# Bind("ADDRESS_2") %>' />
<br />
ADDRESS_3:
<asp:TextBox ID="ADDRESS_3TextBox" runat="server"
Text='<%# Bind("ADDRESS_3") %>' />
<br />
ADDRESS_4:
<asp:TextBox ID="ADDRESS_4TextBox" runat="server"
Text='<%# Bind("ADDRESS_4") %>' />
<br />
ADDRESS_5:
<asp:TextBox ID="ADDRESS_5TextBox" runat="server"
Text='<%# Bind("ADDRESS_5") %>' />
<br />
ADDRESS_6:
<asp:TextBox ID="ADDRESS_6TextBox" runat="server"
Text='<%# Bind("ADDRESS_6") %>' />
<br />
POSTCODE:
<asp:TextBox ID="POSTCODETextBox" runat="server"
Text='<%# Bind("POSTCODE") %>' />
<br />
COUNTRY:
<asp:TextBox ID="COUNTRYTextBox" runat="server" Text='<%# Bind("COUNTRY") %>' />
<br />
ORG_ID:
<asp:TextBox ID="ORG_IDTextBox" runat="server" Text='<%# Bind("ORG_ID") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate
rolleyes


Any pointers in the right direction would be appreciated.

Thanks in advance

Tushar

Can you post the stored procedure/sql statement that performs the insert?

|||

INSERT INTO smTbl_DetailsID (PERSONAL_ID, SURNAME, CHRISTIAN_NAME, SEX, FAMILY_POSITION, FAMILY_ID, ADDRESS_1, ADDRESS_2, ADDRESS_3, ADDRESS_4, ADDRESS_5, ADDRESS_6, POSTCODE, COUNTRY, ORG_ID)VALUES (@.PERSONAL_ID,@.SURNAME,@.CHRISTIAN_NAME,@.SEX,@.FAMILY_POSITION,@.FAMILY_ID,@.ADDRESS_1,@.ADDRESS_2,@.ADDRESS_3,@.ADDRESS_4,@.ADDRESS_5,@.ADDRESS_6,@.POSTCODE,@.COUNTRY,@.ORG_ID)

Execute mode is Scalar

thanks

Tushar

|||

I've found the solution is to replace

details.AddsmTbl_DetailsIDRow(detail)

inFunction AddNewRecord in the BLL

with

Adapter1.InsertQuery_TAM(PERSONAL_ID, SURNAME, CHRISTIAN_NAME, SEX, _
FAMILY_POSITION, FAMILY_ID, ADDRESS_1, ADDRESS_2, _
ADDRESS_3, ADDRESS_4, ADDRESS_5, ADDRESS_6, POSTCODE, COUNTRY, ORG_ID)

i.e. my user defined insert query.

For some reason adding a new row directly causes the SELECT routine to run, which expects a value for the PERSONAL_ID (primary key). I'm sure I'll discover why in due course.

Also the above is not really very clear in the tutorials.

HTH

TusharCool

Sunday, February 12, 2012

collection name question

1 of my SQL 2000 servers has few databases that acts as backend for web based
..NET applications, most of them is in English and they have collection name:
SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db which
stores Italian text has collection name: <empty> .. my questions are what it
should be? are there any potential problems we can run into? can you change
it afterwords?
TIA
Hi Rafal,
Databases can not have an empty collation. You can check the collation for
the database in Enterprise Manager by right-clicking the database and
selecting Properties, or by executing
SELECT DATABASEPROPERTYEX('<db name>', 'Collation')
in Query Analyzer.
The only place I can think of where you might see an 'empty' collation, is
when you use the table designer in Enterprise Manager and you look at a
character column that has the default collation for the database.
Jacco Schalkwijk
SQL Server MVP
"Rafal W." <RafalW@.discussions.microsoft.com> wrote in message
news:EA462D24-9ECE-4916-A41D-7CEDF1EE969D@.microsoft.com...
>1 of my SQL 2000 servers has few databases that acts as backend for web
>based
> .NET applications, most of them is in English and they have collection
> name:
> SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db
> which
> stores Italian text has collection name: <empty> .. my questions are what
> it
> should be? are there any potential problems we can run into? can you
> change
> it afterwords?
> TIA
>

collection name question

1 of my SQL 2000 servers has few databases that acts as backend for web base
d
.NET applications, most of them is in English and they have collection name
:
SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db whic
h
stores Italian text has collection name: <empty> .. my questions are what it
should be? are there any potential problems we can run into? can you change
it afterwords?
TIAHi Rafal,
Databases can not have an empty collation. You can check the collation for
the database in Enterprise Manager by right-clicking the database and
selecting Properties, or by executing
SELECT DATABASEPROPERTYEX('<db name>', 'Collation')
in Query Analyzer.
The only place I can think of where you might see an 'empty' collation, is
when you use the table designer in Enterprise Manager and you look at a
character column that has the default collation for the database.
Jacco Schalkwijk
SQL Server MVP
"Rafal W." <RafalW@.discussions.microsoft.com> wrote in message
news:EA462D24-9ECE-4916-A41D-7CEDF1EE969D@.microsoft.com...
>1 of my SQL 2000 servers has few databases that acts as backend for web
>based
> .NET applications, most of them is in English and they have collection
> name:
> SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db
> which
> stores Italian text has collection name: <empty> .. my questions are what
> it
> should be? are there any potential problems we can run into? can you
> change
> it afterwords?
> TIA
>

collection name question

1 of my SQL 2000 servers has few databases that acts as backend for web based
.NET applications, most of them is in English and they have collection name:
SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db which
stores Italian text has collection name: <empty> .. my questions are what it
should be? are there any potential problems we can run into? can you change
it afterwords?
TIAHi Rafal,
Databases can not have an empty collation. You can check the collation for
the database in Enterprise Manager by right-clicking the database and
selecting Properties, or by executing
SELECT DATABASEPROPERTYEX('<db name>', 'Collation')
in Query Analyzer.
The only place I can think of where you might see an 'empty' collation, is
when you use the table designer in Enterprise Manager and you look at a
character column that has the default collation for the database.
--
Jacco Schalkwijk
SQL Server MVP
"Rafal W." <RafalW@.discussions.microsoft.com> wrote in message
news:EA462D24-9ECE-4916-A41D-7CEDF1EE969D@.microsoft.com...
>1 of my SQL 2000 servers has few databases that acts as backend for web
>based
> .NET applications, most of them is in English and they have collection
> name:
> SQL_Latin1_General_CP1_Cl_AS.. I just noticed that recently deployed db
> which
> stores Italian text has collection name: <empty> .. my questions are what
> it
> should be? are there any potential problems we can run into? can you
> change
> it afterwords?
> TIA
>