Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I have customer register form (with ssn,fname,lname,address,apt,city,state,zip,custid) which will store datas in 4 different tables.

 

I am trying to create more controls like Add,Update,Delete.

 

For updating ,i am getting their custid as input and i need to update all tables by using custid.

I know that for updating we need to use this command, "Update table customer set name ="fsgf" where custid = ' &idtext.text &'"

 

But i need to update morethan 8-9 columns(ssn,fname...).Do i need to do this update query 9 times or is there anyother way for this?

 

thanks

Posted

to update several columns in a single table you can use this:

 

UPDATE TABLE1 SET COLUMN1 = 'string value',

COLUMN2 = 12345,

COLUMN3 = 'string value',

COLUMN4 = 'string value'

WHERE COLUMN5 = 12345

 

if you're updating several tables at the same time with the same information the best approach will be to use a Stored Procedure (if you have SQL Server or any database that support SP's) otherwise, create the UPDATE queries you need for the tables you need to update

Fat kids are harder to kidnap
Posted

thanks

 

Hi,

Thanks for the reply.

It worked fine for me.

 

Do u know how to pass arguments from one form to another form?

I want to pass the variable value from one form to another form.

 

Thanks

Posted

For update is it not possible to use this:

 

dap1.Update(das1, "table")

 

I am using a datagrid.

I am able to fill my datagrid.

I would like to enter information into the datagrid and for it to be entered into the database.

Enter information in the cell and press and 'update' button which has the above code in it.

But I cant get it to work as i get this error:

 

An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll

Additional information: Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...