🔒 Closed Vb.net with mysql

Status
Not open for further replies.

kram0256

Fanatic
Pa tulong naman ng codes para update mga paps yaw mag function ng uodate button ko
Ito po

Untitled1.jpg Untitled-1.jpg
 
your code seems to be okay but try using this code Snippet. Im using MSSQLServer here.

I supposed to update the firstname from a particular table. the new value was set into the fname string variable.
I used the using keyword here for the automatic disposal of the objects connection and command

Dim constring As String = "your_connectionstring_here"
Dim query As String = "your_commandtext_here"
Dim fname As String = "name_to_be_set_as_new_firtsname_value"
Try
Using con As SqlConnection = New SqlConnection(constring)
Using cmd As SqlCommand = New SqlCommand()
cmd.CommandText = query
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@fname", fname)
cmd.Connection = con
con.Open()
cmd.ExecuteNonQuery()
End Using
End Using
Catch ex As Exception
'some exception handling here
End Try


let me know how it works from your project.
 
mas recommended po ba na MySql database kesa sa 1st choice ko na SQL Server medyo hirap po kasi ako mag connect thru ip address at lan network. Salamat po sa sagot
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 640
    Views
  • 5
    Participants
Last reply from:
PHC-Xes

Trending Topics

Online now

Members online
1,123
Guests online
3,289
Total visitors
4,412

Forum statistics

Threads
2,282,803
Posts
29,011,219
Members
1,223,107
Latest member
amen01
Back
Top