Click here to Skip to main content
15,867,834 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: OdbcCommand not taking Pin
Colin Angus Mackay10-Jul-06 12:20
Colin Angus Mackay10-Jul-06 12:20 
AnswerRe: OdbcCommand not taking Pin
Guffa10-Jul-06 7:06
Guffa10-Jul-06 7:06 
GeneralRe: OdbcCommand not taking Pin
HahnTech10-Jul-06 10:19
HahnTech10-Jul-06 10:19 
GeneralRe: OdbcCommand not taking Pin
led mike10-Jul-06 10:39
led mike10-Jul-06 10:39 
GeneralRe: OdbcCommand not taking Pin
HahnTech10-Jul-06 11:34
HahnTech10-Jul-06 11:34 
GeneralRe: OdbcCommand not taking Pin
led mike10-Jul-06 12:08
led mike10-Jul-06 12:08 
GeneralRe: OdbcCommand not taking Pin
HahnTech10-Jul-06 13:21
HahnTech10-Jul-06 13:21 
AnswerRe: OdbcCommand not taking Pin
Guffa10-Jul-06 12:26
Guffa10-Jul-06 12:26 
QuestionSendMessage problem Pin
psyonara10-Jul-06 5:52
psyonara10-Jul-06 5:52 
AnswerRe: SendMessage problem Pin
LongRange.Shooter10-Jul-06 8:16
LongRange.Shooter10-Jul-06 8:16 
AnswerRe: SendMessage problem Pin
mav.northwind10-Jul-06 9:02
mav.northwind10-Jul-06 9:02 
QuestionHiding a control Pin
joshp121710-Jul-06 5:21
joshp121710-Jul-06 5:21 
AnswerRe: Hiding a control Pin
Ravi Bhavnani10-Jul-06 5:31
professionalRavi Bhavnani10-Jul-06 5:31 

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.