Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
QuestionHow to use the texture as the background of bars in mschart? Pin
luckyeagle17-Jul-05 15:09
luckyeagle17-Jul-05 15:09 
Generalweird threads in forms Pin
mihai_152917-Jul-05 11:37
mihai_152917-Jul-05 11:37 
GeneralRe: weird threads in forms Pin
Rob Graham17-Jul-05 12:10
Rob Graham17-Jul-05 12:10 
GeneralRe: weird threads in forms Pin
S. Senthil Kumar17-Jul-05 18:08
S. Senthil Kumar17-Jul-05 18:08 
GeneralRe: weird threads in forms Pin
mihai_152918-Jul-05 1:49
mihai_152918-Jul-05 1:49 
Generale-mail status Pin
Member 210401417-Jul-05 10:08
Member 210401417-Jul-05 10:08 
GeneralRe: e-mail status Pin
Member 198359717-Jul-05 20:43
Member 198359717-Jul-05 20:43 
GeneralInsert in SP using OdbcCommand Object Pin
lovelylooney17-Jul-05 9:49
lovelylooney17-Jul-05 9:49 
I have created a Stored Procedure and I am trying to insert in to tables using the stored procedure by passin parameters from the GUI.

My problem is, Stored procedure works fine if I use SqlCommand object. But now I am using OdbcCommand object which is creaing issue whenever I try to insert using the SP's. The error I get when I use OdbcCommand object is "There is no paramter supplied for @PRDD_CustomerICA" which incidentally is the first parameter that I am passing. Parameter Order in SP and frontend code is also similar. Using SqlCommand object works fine which indicates that SP is fine.

I am coping a part of my code with few parameters that I am passing to the SP. Could anyone please let me knw what I am missing? Is there something extra required to do for OdbcCommand object?

bool blnInserted = true;

OdbcTransaction tran = con.BeginTransaction();

OdbcCommand cmd = new OdbcCommand("InsertNewShipment", con);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add("@PRDD_CustomerICA", txtBillICA.Text.Trim());
cmd.Parameters.Add("@PRDD_ProductID", intProdID);

cmd.Parameters.Add("@AST_Refnr", txtRef.Text.Trim());
cmd.Parameters.Add("@AST_DefID", intAstDefID);
cmd.Parameters.Add("@AST_StatusID", intShipStatus2ID);
cmd.Parameters.Add("@AST_ICA", txtBillICA.Text.Trim());
cmd.Parameters.Add("@AST_RegionID", intRegID);
cmd.Parameters.Add("@AST_Billable", intBillable);
cmd.Parameters.Add("@AST_ExpirationDate", dtpLicFileExpDate.Value);
cmd.Parameters.Add("@AST_Comments", txtShippingComments.Text.Trim());

cmd.Transaction = tran;
cmd.ExecuteNonQuery();

if(blnInserted == true)
{
tran.Commit();
}

This forum has helped me a lot and I hope I will get an answer soon.

Thanks a lot in advance
GeneralRe: Insert in SP using OdbcCommand Object Pin
lovelylooney17-Jul-05 9:55
lovelylooney17-Jul-05 9:55 
GeneralRe: Insert in SP using OdbcCommand Object Pin
Rob Graham17-Jul-05 10:10
Rob Graham17-Jul-05 10:10 
GeneralRe: Insert in SP using OdbcCommand Object Pin
Michael P Butler17-Jul-05 10:16
Michael P Butler17-Jul-05 10:16 
Generalchess programming code Pin
iramg17-Jul-05 7:48
iramg17-Jul-05 7:48 
GeneralRTFM Pin
DavidNohejl17-Jul-05 11:18
DavidNohejl17-Jul-05 11:18 
GeneralRe: RTFM Pin
Alex Korchemniy17-Jul-05 14:28
Alex Korchemniy17-Jul-05 14:28 
GeneralRe: RTFM Pin
Tomas Petricek17-Jul-05 15:02
Tomas Petricek17-Jul-05 15:02 
GeneralRe: RTFM Pin
DavidNohejl18-Jul-05 2:50
DavidNohejl18-Jul-05 2:50 
GeneralBasic combo box question Pin
sea#17-Jul-05 5:48
sea#17-Jul-05 5:48 
GeneralNetWorking problem! Pin
Micu Radu17-Jul-05 2:59
Micu Radu17-Jul-05 2:59 
GeneralRegular expression efficiency Pin
AnonymousTwo17-Jul-05 1:59
AnonymousTwo17-Jul-05 1:59 
GeneralRe: Regular expression efficiency Pin
Brian Delahunty17-Jul-05 4:01
Brian Delahunty17-Jul-05 4:01 
GeneralRe: Regular expression efficiency Pin
AnonymousTwo17-Jul-05 5:09
AnonymousTwo17-Jul-05 5:09 
GeneralRe: Regular expression efficiency Pin
Brian Delahunty17-Jul-05 5:26
Brian Delahunty17-Jul-05 5:26 
GeneralRe: Regular expression efficiency Pin
AnonymousTwo17-Jul-05 6:09
AnonymousTwo17-Jul-05 6:09 
GeneralRe: Regular expression efficiency Pin
Brian Delahunty17-Jul-05 7:30
Brian Delahunty17-Jul-05 7:30 
GeneralC# Obfuscations - need your input on my questionnaires please Pin
Chua Wen Ching17-Jul-05 1:55
Chua Wen Ching17-Jul-05 1:55 

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.