Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Anil000
Starting Member
4 Posts |
Posted - 2008-08-14 : 01:00:57
|
Hi, i'm trying to insert the data into DataTable. The table consists of Two Primary Keys.Table Structure:StationCategoryLinkFields: StationCode, CategoryCodeSample Data : 1 FC 1 SD 1 AS 1 TR 2 DF 2 DGCan you please help me in writing this query.. Its very urgent for me..Thanks&Regards,Anil |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-14 : 01:19:34
|
Can you post what you've tried so far? If you've not tried yet. have a look at INSERT statement in books online for assistance. |
 |
|
Anil000
Starting Member
4 Posts |
Posted - 2008-08-14 : 01:53:24
|
Hi, actually, i'm trying to update the database table depending upon the checkbox being selected from CheckBoxList.The code i've used for this is:Do While (i < chkSerCat.Items.Count) For Each itm As ListItem In chkSerCat.Items If itm.Selected Then InsertValues(Cdn, chkSerCat.SelectedValue, Con) Else lblMsg.Text = "Please enter atleast one value" End If Next i = (i + 1) LoopCan you plese tell me, where the bug is?Thanks&Regards,Anil |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-14 : 02:10:25
|
is this vb? |
 |
|
Anil000
Starting Member
4 Posts |
Posted - 2008-08-14 : 02:22:34
|
Yes, Sorry, in the code i'm trying to insert the values into database. Depending upon the StationCode value,i've to insert different category code values. This is the point where i got strucked. Just for explaining the scenario, i've posted the vb code. Can you please let me know, how to insert different CategoryCode for Same StationCode, where StationCode anad CategoryCode are both set as primary keys?Thanks&Regards,Anil |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-14 : 02:39:04
|
are you asking sql query or code in vb? |
 |
|
Anil000
Starting Member
4 Posts |
Posted - 2008-08-14 : 02:53:42
|
Hi, Thanks for your response. I want SQL query for this. Can you please provide me the query..Thanks&Regards,Anil |
 |
|
|
|
|
|
|