From: Mario on
If I have two tables:
Customer
ID
Name
Adress

and Orders
ID
IDCustomer (related with the Customer Name, because Customer ID wasn't
inserted yet, because both tables are inserted on the same page)
Product
Quantity
Price

I simply enter customer data through the TextBoxes and save data:
string sql = "INSERT ...";

using (

SqlConnection myConnection =

new
SqlConnection(ConfigurationManager.ConnectionStrings["BaseConnectionString"].ConnectionString))

{

......

myConnection.Open();

myCommand.ExecuteNonQuery();

myConnection.Close();


Order table deals through the ListView, ObjectDataSource and DataSet,
showing Product, Quantity and Price columns. ID column is automatic.
The problem is with IDCustomer column which needs to fill automatic,
according to a Customer ID. I was thinking that it will be easy to change
the DataSetExample.Designer.cs (generated by VS2008). I was thinking to
change Insert code by adding @IDCustomer as SQL Parameter and than read the
Name textbox, but texboxes are not available. Session variable is not
available too.
So, could you please suggest me the way to solve the problem
Thnx





 | 
Pages: 1
Prev: AJAX Control Toolkit
Next: SqlTransaction problem