Click here to Skip to main content
15,887,886 members
Home / Discussions / C#
   

C#

 
AnswerRe: returning more than one item Pin
Aaron Dilliard11-Jul-06 4:09
Aaron Dilliard11-Jul-06 4:09 
Questiondisplay folder path in dialog text box Pin
x2pca10-Jul-06 9:41
x2pca10-Jul-06 9:41 
AnswerRe: display folder path in dialog text box Pin
Christian Graus10-Jul-06 9:52
protectorChristian Graus10-Jul-06 9:52 
GeneralRe: display folder path in dialog text box Pin
Jun Du10-Jul-06 10:05
Jun Du10-Jul-06 10:05 
QuestionRe: display folder path in dialog text box Pin
Nader Elshehabi10-Jul-06 13:49
Nader Elshehabi10-Jul-06 13:49 
AnswerRe: display folder path in dialog text box Pin
Jun Du10-Jul-06 15:32
Jun Du10-Jul-06 15:32 
JokeRe: display folder path in dialog text box Pin
Nader Elshehabi10-Jul-06 16:20
Nader Elshehabi10-Jul-06 16:20 
AnswerRe: display folder path in dialog text box Pin
Josh Smith10-Jul-06 10:37
Josh Smith10-Jul-06 10:37 
QuestionDataset copy Pin
Small Rat10-Jul-06 8:36
Small Rat10-Jul-06 8:36 
AnswerRe: Dataset copy Pin
Josh Smith10-Jul-06 8:40
Josh Smith10-Jul-06 8:40 
QuestionCalcBalance does not exist in the current context Pin
Skanless10-Jul-06 7:09
Skanless10-Jul-06 7:09 
AnswerRe: CalcBalance does not exist in the current context Pin
Robert Rohde10-Jul-06 7:42
Robert Rohde10-Jul-06 7:42 
AnswerRe: CalcBalance does not exist in the current context Pin
LongRange.Shooter10-Jul-06 8:26
LongRange.Shooter10-Jul-06 8:26 
AnswerRe: CalcBalance does not exist in the current context Pin
wasife10-Jul-06 8:28
wasife10-Jul-06 8:28 
GeneralRe: CalcBalance does not exist in the current context Pin
Josh Smith10-Jul-06 8:37
Josh Smith10-Jul-06 8:37 
AnswerRe: CalcBalance does not exist in the current context Pin
Skanless10-Jul-06 16:37
Skanless10-Jul-06 16:37 
GeneralRe: CalcBalance does not exist in the current context Pin
J4amieC10-Jul-06 21:57
J4amieC10-Jul-06 21:57 
QuestionShow the "video capture filter " form in c# Pin
davilovick10-Jul-06 6:54
davilovick10-Jul-06 6:54 
AnswerRe: Show the "video capture filter " form in c# Pin
LongRange.Shooter10-Jul-06 8:21
LongRange.Shooter10-Jul-06 8:21 
JokeRe: Show the "video capture filter " form in c# Pin
Malcolm Smart10-Jul-06 20:53
Malcolm Smart10-Jul-06 20:53 
QuestionOdbcCommand not taking Pin
HahnTech10-Jul-06 6:21
HahnTech10-Jul-06 6:21 
I’m having troubles with the following code:

txtSelect.Text = “Select System_id From [DFIParmsHTS].[docsadm].[ExtGroup] where CustNumber = _CustomerNumber”
OdbcCommand cmdSelect= new OdbcCommand(txtSelect.Text, conn);
cmdSelect.CommandType=CommandType.Text;
cmdSelect.Parameters.Add("_CustomerNumber", vfx.TNM);
dr = cmdSelect.ExecuteReader();

Throws SQLSRV32.DLL - ERROR [42S22] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name '_CustomerNumber'

No kidding _CustomerNumber is an Invalid Column name. I’m trying to replace it with vfx.TNM. If I look at the Command object in the watch window Parameters.items[0].parametername = “_CustomerNumber” and Parameters.items[0].Value = “000122”

So why isn’t it getting to the db that way.

I’ve also tried

txtSelect.Text = “Select System_id From [DFIParmsHTS].[docsadm].[ExtGroup] where CustNumber = @CustomerNumber”
OdbcCommand cmdSelect= new OdbcCommand(txtSelect.Text, conn);
cmdSelect.CommandType=CommandType.Text;
cmdSelect.Parameters.Add("@CustomerNumber", vfx.TNM);
dr = cmdSelect.ExecuteReader();

Throws SQLSRV32.DLL - ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@CustomerNumber'

So to me it looks like the Command isn’t committing the changes of the parameters to the query. That made me try:

txtSelect.Text = “Select System_id From [DFIParmsHTS].[docsadm].[ExtGroup] where CustNumber = @CustomerNumber”
OdbcCommand cmdSelect= new OdbcCommand(txtSelect.Text, conn);
cmdSelect.CommandType=CommandType.Text;
cmdSelect.Parameters.Add("@CustomerNumber", vfx.TNM);
cmdSelect.Prepare();
dr = cmdSelect.ExecuteReader();

And that didn’t work either.

Any help is appreciated, Thanks.


Ronald Hahn, CNT - Computer Engineering Technologist

New Technologies Analyst

HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net


AnswerRe: OdbcCommand not taking Pin
Not Active10-Jul-06 6:50
mentorNot Active10-Jul-06 6:50 
GeneralRe: OdbcCommand not taking Pin
HahnTech10-Jul-06 10:16
HahnTech10-Jul-06 10:16 
GeneralRe: OdbcCommand not taking Pin
Not Active10-Jul-06 11:33
mentorNot Active10-Jul-06 11:33 
GeneralRe: OdbcCommand not taking Pin
HahnTech10-Jul-06 13:23
HahnTech10-Jul-06 13:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.