TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Robert Reese
NA
3
0
How can insert and update datagrid in VB.net Application
Jan 10 2009 5:44 AM
How can insert and update datagrid in VB.net Application?
I have tried using this code for my vb.net application. It compiles with no errors but it does not update the database. I want to be able to update all the columns in the database when all the fields have been filled. Here is the code I placed. I will try to post a screenshot in case you might need one.
Thank You
Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.GameTableAdapter.Fill(Me.DataSet1.Game)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
End Sub
End Class
Public Class MainClass
Shared Sub Main()
Dim MyDS As DataSet = New DataSet()
Dim Connection As SqlConnection = New SqlConnection( _
"Server=(local)\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=SSPI")
Connection.Open()
Dim MyDA As SqlDataAdapter = New SqlDataAdapter( _
"SELECT * FROM [Bowl] OD", Connection)
Dim myBuilder As SqlCommandBuilder = New SqlCommandBuilder(MyDA)
Console.WriteLine(myBuilder.GetUpdateCommand().CommandText)
End Sub
End Class
Reply
Answers (
1
)
Comparing valid data input in VB
difference between Convert.ToString() and i.ToString()