Click here to Skip to main content
15,914,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionConstant Module Or File ? Pin
barney_19729-Oct-07 22:09
barney_19729-Oct-07 22:09 
AnswerRe: Constant Module Or File ? Pin
Tom Deketelaere9-Oct-07 22:51
professionalTom Deketelaere9-Oct-07 22:51 
GeneralRe: Constant Module Or File ? Pin
barney_19729-Oct-07 23:21
barney_19729-Oct-07 23:21 
QuestionOld array function does not work in VB 2005? Pin
Nasbcn9-Oct-07 22:05
Nasbcn9-Oct-07 22:05 
AnswerRe: Old array function does not work in VB 2005? Pin
Tom Deketelaere9-Oct-07 22:47
professionalTom Deketelaere9-Oct-07 22:47 
GeneralRe: Old array function does not work in VB 2005? Pin
Nasbcn9-Oct-07 23:37
Nasbcn9-Oct-07 23:37 
QuestionSort Unbound Datagridview column Pin
helelark1239-Oct-07 20:25
helelark1239-Oct-07 20:25 
QuestionDataset Pin
vidya1109-Oct-07 20:12
vidya1109-Oct-07 20:12 
Hi All,

I have a table Named Table1 and i have displayed all the records in a datagridview and after i make changes ie.Edit the Datagird i want to save the changes to the same table after i click Update Button.
Can anyone tell me how to do this updation at a time not record by record


Example of what i have done:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Vidya\Visual Studio 2005 Projects\DatasetProject\Sample.mdb"
con.Open()
cmd.Connection = con
cmd.CommandText = "Select * from Table1"
da.SelectCommand = cmd
da.Fill(pTable)
DataGridView1.DataSource = pTable
dr = pTable.NewRow()
dr("Name") = "Doe"
dr("Place") = "John"
dr("Email") = "120"
pTable.Rows.Add(dr)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Cb As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(da)

da.Update(pTable)
MsgBox("Updated")
con.Close()
DataGridView2.DataSource = pTable

End Sub


When i give the da.Update(pTable) or dataset
It gives me following error:

Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.


I think u have got what i am doing

Thank in advanceBlush | :O
AnswerRe: Dataset [modified] Pin
vidya11010-Oct-07 0:15
vidya11010-Oct-07 0:15 
GeneralRe: Dataset Pin
Vimalsoft(Pty) Ltd10-Oct-07 23:13
professionalVimalsoft(Pty) Ltd10-Oct-07 23:13 
Questionforms loading [modified] Pin
chamee1239-Oct-07 19:13
chamee1239-Oct-07 19:13 
AnswerRe: forms loading Pin
Christian Graus9-Oct-07 19:32
protectorChristian Graus9-Oct-07 19:32 
AnswerRe: forms loading Pin
manni_n10-Oct-07 2:29
manni_n10-Oct-07 2:29 
QuestionEXCEPTION FROM HRESULT Pin
dienadel9-Oct-07 18:06
dienadel9-Oct-07 18:06 
AnswerRe: EXCEPTION FROM HRESULT Pin
Christian Graus9-Oct-07 18:29
protectorChristian Graus9-Oct-07 18:29 
AnswerRe: EXCEPTION FROM HRESULT Pin
ChandraRam9-Oct-07 21:41
ChandraRam9-Oct-07 21:41 
QuestionUsing TAP messaging protocol Pin
Jack Black X9-Oct-07 17:35
Jack Black X9-Oct-07 17:35 
Questioncheckbox defaults not set on batabound vb form with strong typed dataset Pin
pa281409-Oct-07 15:22
pa281409-Oct-07 15:22 
Questionimages in the button Pin
shri509-Oct-07 14:50
shri509-Oct-07 14:50 
AnswerRe: images in the button Pin
Luc Pattyn9-Oct-07 14:56
sitebuilderLuc Pattyn9-Oct-07 14:56 
QuestionCreating Tab Delimited Output File Pin
Swisher249-Oct-07 13:18
Swisher249-Oct-07 13:18 
AnswerRe: Creating Tab Delimited Output File Pin
Christian Graus9-Oct-07 13:23
protectorChristian Graus9-Oct-07 13:23 
AnswerRe: Creating Tab Delimited Output File [modified] Pin
Luc Pattyn9-Oct-07 13:55
sitebuilderLuc Pattyn9-Oct-07 13:55 
AnswerRe: Creating Tab Delimited Output File Pin
Dave Kreskowiak9-Oct-07 17:14
mveDave Kreskowiak9-Oct-07 17:14 
GeneralRe: Creating Tab Delimited Output File Pin
Swisher2410-Oct-07 6:44
Swisher2410-Oct-07 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.