DataSetExample.Designer.cs

M

Mario

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top