Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
SQL Command CmdNew

SQL Command CmdNew

Ratings: (0)|Views: 446|Likes:
Published by api-3841500

More info:

Published by: api-3841500 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

SqlCommand cmdNew = new SqlCommand("ProcessNewOrder",
this.sqlConnection1);
SqlDataAdapter sdaNew = new SqlDataAdapter(cmdNew);
// Let the SQL command know the type of command we are

going to use
// In this case, it is a stored procedure
cmdNew.CommandType =

CommandType.StoredProcedure;

// We will need a SQL parameter to carry the arguments
// Declare its variable
SqlParameter parNew = new SqlParameter();
// Specify the name of the argument

parNew.ParameterName = "@ProcessedBy";
// Specify the SQL data type of the argument
parNew.SqlDbType

= SqlDbType.Int;
// Specify the value passed as argument
parNew.Value

= this.cboProcessedBy.SelectedIndex;
// Once the argument is ready, add it to the list of arguments
cmdNew.Parameters.Add(parNew);
parNew = new SqlParameter();
parNew.ParameterName = "@DateOrdered";
parNew.SqlDbType
= SqlDbType.SmallDateTime;
parNew.Value
= this.dtpOrderDate.Value;
cmdNew.Parameters.Add(parNew);
parNew = new SqlParameter();
parNew.ParameterName = "@TimeOrdered";
parNew.SqlDbType
= SqlDbType.SmallDateTime;
parNew.Value
= this.dtpOrderTime.Value;
cmdNew.Parameters.Add(parNew);
parNew = new SqlParameter();
parNew.ParameterName = "@ContainerType";
parNew.SqlDbType
= SqlDbType.Int;
parNew.Value
= this.cboContainer.SelectedIndex;
cmdNew.Parameters.Add(parNew);
parNew = new SqlParameter();
parNew.ParameterName = "@SelectedFlavor";
parNew.SqlDbType
= SqlDbType.Int;
parNew.Value
= this.cboFlavor.SelectedIndex;
cmdNew.Parameters.Add(parNew);

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->