Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, March 21, 2012

Problems With OLE DB Command Transformer

I am trying to use the OLE DB Command Transformation to update rows in my table. When I make the connections and select the connectionmanager I get the following error:


Error at Data Flow Task [OLE DB Command [6624]]: An OLE DB error has occurred. Error code: 0x80040E0C.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object.".

I cannot figure out what to do. The connection is valid. I have used it in many places in the data stream. I also see that there are no output columns available for mapping. I didn't see a place to select the table.

Can anyone please help.

Thanks,

Lee


Make sure you are setting the SQLCommand property (on the Component Properties tab) with your UPDATE statement.|||Thanks. One more question - Do you have to use ? (i.e. scope = ?) for the parameters in the SQL statement or can you use something that is more meaningful?|||With most OLE DB drivers, you do need to use ?. That is the way the drivers expect to see parameter placeholders.

Tuesday, March 20, 2012

Problems with MSDE

Hi, Have installed MSDE on my PC. Downloaded the zip file and went into MSDOS command window and changed directory to MSDE and typed the following :
setup.exe /qb+ INSTANCENAME=NetSDK DISABLENETWORKPROTOCOLS=1 SAPWD=PASSWORD
Did that and restarted my computer and the database icon appeared in the task bar at bottom of screen. Clicked on icon and entered mycomputername\netsdk. Hit start and it indicated that it was running. It runs for about 10seconds and then stops.....does anyone have any idea why it is doing this??
Hope someone can help
Thanks
DarrenHave you checked the event viewer for any messages?|||This is what I get in my event viewer, but have heard this is the norm and will not cause the problem...
warning......
The description for Event ID( 19011 ) in Source ( MSSQL$NETSDK ) cannot be found. The localcomputer may not have the necessary registry information or message DLLfiles to display messages from a remote computer. You may be able touse the /AUXSOURCE= flag to retrieve this description; see Help andSupport for details. The following information is part of the event:(SpnRegister) : Error 1355.

Wednesday, March 7, 2012

Problems with DateTime

Hello all,
I have a problem when I try to insert with a SQL Command a value obtained from a Calendar Control in a SQL Server table. I get the date from the calendar and I put it in a TextBox, but when I try to insert this value in a DateTime defined field I have the following error:
The string or binary data would be truncated. The instruction was finished.

Could you help me?

Thanks.You need to convert the text into a c#/vb date type first. You're prob' hitting a localization issue with the date format.|||I'm certainly no SQL server pro but from my limited experience, SQL server is persnickety about datetime values. I avoid the problem altogether by passing the date in your SQL statement as a string (wrapping it w/in single quotes) or, if you are using sprocs, converting it to datetime w/in the sproc in SQL Server.

good luck.|||No don't wrap it as a string that's exactly where you start getting the problems. If you wrap it as a string you need to either know the database format (and be able to convert to it) or you have to convert to a universal format. Much better to use a param.

Saturday, February 25, 2012

Problems with : SqlDataReader = Command.ExecuteReader()

I am currently tryinh to have this variable declared :
Dim SQLLecteur As SqlDataReader = Command.ExecuteReader()
And receiving the following error : 'ExecuteReader' is not member of 'String'.

1. The ExecuteReader was not present in the list following the Command.
2. The variable is declared from a : Public Shared Sub
3. This sub is located in a code library referenced in the web.config as a namespace : <add namespace="PAX20070409" />
4. If used directly in the .vb file within this sub : Protected Sub btnConnection_Click, I am not receiving any errors about the Dim.

It is pretty clear why the code is not working, but I have not been able to find a way to fix the problem. I am currently trying to find a way to make the Dim work from within my code library. If you have any idea on how this could be achieve, it would be greatly apreciated.

Thank you :)
RV3

looks that you Command is declared somewhere as string or is not declared and system use string type as default

try

dim SQLCommand as sqlclient.sqlcommand = new sqlclient.sqlcommand("Your command name")

'setup connection for your command

'open your connection

Dim SQLLecteur As SqlDataReader = SQLCommand.ExecuteReader()

'close your connection

example:

Dim queryString As String = _
"SELECT OrderID, CustomerID FROM dbo.Orders;"

Using connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(queryString, connection)
connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

' Call Read before accessing data.
While reader.Read()
Console.WriteLine(String.Format("{0}, {1}", _
reader(0), reader(1)))
End While

' Call Close when done reading.
reader.Close()
End Using|||

yOUR CODE SHOULD LOOK LIEK THIS ONE

Dim queryString As String = _
"SELECT OrderID, CustomerID FROM dbo.Orders;"

Using connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(queryString, connection)
connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

' Call Read before accessing data.
While reader.Read()
Console.WriteLine(String.Format("{0}, {1}", _
reader(0), reader(1)))
End While

' Call Close when done reading.
reader.Close()
End Using

|||

Public Shared SQLConnection As New SqlConnection(ConfigurationManager.AppSettings("BDD_LILILUX"))
Public Shared SQLCommande As SqlClient.SqlCommand = New SqlClient.SqlCommand("SQLCommande")

This is the answer, it is working marvellously fine now :)

Thank you :)

|||

Missed a line :P

Dim SQLLecteur As SqlDataReader = SQLCommande.ExecuteReader