Click here to Skip to main content
16,004,901 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to change value in datagrid output Pin
Lisana3-Mar-05 3:46
Lisana3-Mar-05 3:46 
AnswerRe: how to change value in datagrid output Pin
numbrel3-Mar-05 14:59
numbrel3-Mar-05 14:59 
GeneralRe: how to change value in datagrid output Pin
Lisana4-Mar-05 7:57
Lisana4-Mar-05 7:57 
GeneralVB Script to extract message from an IBM MQ Queue Pin
Member 3490943-Mar-05 2:58
Member 3490943-Mar-05 2:58 
QuestionHow to get MX Entries of a Domain Pin
LORDSASH3-Mar-05 2:28
LORDSASH3-Mar-05 2:28 
AnswerRe: How to get MX Entries of a Domain Pin
Dave Kreskowiak4-Mar-05 3:19
mveDave Kreskowiak4-Mar-05 3:19 
Generalrefresh dataset Pin
sumi17102-Mar-05 22:20
sumi17102-Mar-05 22:20 
GeneralRe: refresh dataset Pin
Mandar Patankar3-Mar-05 7:29
Mandar Patankar3-Mar-05 7:29 
Hi
From the code which you have posted it seems that you are updating the dataset. Updating the dataset wont update the database.
when you refresh the form the dataset is loaded again from that database so u dont see the necessary changes in the datagrid.For your requitement why dont you try the Following code

Private WithEvents daemp As New SqlDataAdapter("select * from emp",cn)


'Write this code whereever you are populating the dataset which can
'be a load button
Dim ds As New DataSet
daemp.Fill(ds, "emp")
dgemp.DataSource = ds.Tables(0)

'once u make changes u need to save the chages write this code in \
'next prev pageindexchanged code...also write it in save

Dim dt As New DataTable
dt = dgemp.DataSource
Try
'updating the database with dataadapter using new dataset table
daemp.Update(dt)
MessageBox.Show("update done")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

'this is event if you insert wrong data
Private Sub daemp_RowUpdated(ByVal sender As Object, ByVal e As System.Data.SqlClient.SqlRowUpdatedEventArgs) Handles daemp.RowUpdated
If e.Status = UpdateStatus.ErrorsOccurred Then
e.Row.RowError = "mandar says error"
e.Status = UpdateStatus.Continue

End If
End Sub

Hope this helps



Mandar Patankar
Microsoft Certified professional
GeneralUsing GroupBox with Tabcontrol Pin
fontahfru2-Mar-05 20:24
fontahfru2-Mar-05 20:24 
Generalwhat's significant diferrences between vb 6.0 and vb.net Pin
solvavou2-Mar-05 19:06
solvavou2-Mar-05 19:06 
GeneralRe: what's significant diferrences between vb 6.0 and vb.net Pin
Just Greeky Creek3-Mar-05 0:12
Just Greeky Creek3-Mar-05 0:12 
GeneralRe: what's significant diferrences between vb 6.0 and vb.net Pin
rwestgraham3-Mar-05 14:24
rwestgraham3-Mar-05 14:24 
GeneralStill trying this data filter Pin
DavidMLevine2-Mar-05 17:02
DavidMLevine2-Mar-05 17:02 
GeneralRe: Still trying this data filter Pin
DavidMLevine3-Mar-05 2:21
DavidMLevine3-Mar-05 2:21 
Generalhelp.. :( reverse reading of the log file Pin
MagicGirL832-Mar-05 16:57
MagicGirL832-Mar-05 16:57 
GeneralRe: help.. :( reverse reading of the log file Pin
Dave Kreskowiak3-Mar-05 4:20
mveDave Kreskowiak3-Mar-05 4:20 
GeneralRe: help.. :( reverse reading of the log file Pin
MagicGirL833-Mar-05 11:36
MagicGirL833-Mar-05 11:36 
Generaltransform vb to vb.net Pin
lily822-Mar-05 14:08
lily822-Mar-05 14:08 
GeneralRe: transform vb to vb.net Pin
Christian Graus2-Mar-05 15:23
protectorChristian Graus2-Mar-05 15:23 
GeneralRe: transform vb to vb.net Pin
Dave Kreskowiak3-Mar-05 4:06
mveDave Kreskowiak3-Mar-05 4:06 
General.NET set-project installer creates software-entries twice Pin
Philipp3442-Mar-05 10:08
sussPhilipp3442-Mar-05 10:08 
GeneralThe format of the file 'system' is invalid. Pin
Anonymous2-Mar-05 7:51
Anonymous2-Mar-05 7:51 
GeneralRe: The format of the file 'system' is invalid. Pin
Dave Kreskowiak4-Mar-05 3:21
mveDave Kreskowiak4-Mar-05 3:21 
GeneralStreamReader constructor fails in FileWatcher event handler Pin
2-Mar-05 4:27
suss2-Mar-05 4:27 
GeneralRe: StreamReader constructor fails in FileWatcher event handler [Edit] Pin
Mitch F.2-Mar-05 6:32
Mitch F.2-Mar-05 6:32 

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.