•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 401,531 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,347 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 993 | Replies: 3
![]() |
•
•
Join Date: Nov 2007
Location: ★ Jogja ★
Posts: 2,473
Reputation:
Rep Power: 9
Solved Threads: 215
show use your code and effort. we will help u
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Mar 2008
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
Here is code :
but records can not update into database . please help me
vbnet Syntax (Toggle Plain Text)
Imports System.data.SqlClient Public Class Form1 Dim s As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=D:\csdl1.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" Dim connect As New SqlConnection(s) Dim da As New SqlDataAdapter Dim ds As New DataSet Dim cmd As New SqlCommand Dim them1 As Boolean = False Dim xoa As Boolean = False Dim sua As Boolean = False Private Sub exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exit.Click End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try connect.Open() MessageBox.Show("connect ok") Catch ex As Exception MessageBox.Show(ex.ToString) End Try End Sub Private Sub showdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles showdata.Click If connect.State = ConnectionState.Closed Then connect.Open() Else Dim s As String = "select * from huycnt" cmd.CommandText = s cmd.CommandType = CommandType.Text cmd.Connection = connect da.SelectCommand = cmd ds.Clear() da.Fill(ds, "huycnt") dg.DataSource = ds.Tables("huycnt").DefaultView End If connect.Close() End Sub Private Sub add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles add.Click txtma.Focus() End Sub Private Sub Save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Save.Click If connect.State = ConnectionState.Closed Then connect.Open() Else Dim s As String = "insert into huycnt(id,name)values ('" + txtid.Text + "', '" + txtname.Text + "')" cmd.CommandText = s cmd.CommandType = CommandType.Text cmd.Connection = connect da.SelectCommand = cmd da.Fill(ds, "huycnt") 'MessageBox.Show("success ") da.Update(ds, "huycnt") dg.Refresh() End If connect.Close() End Sub End Class
but records can not update into database . please help me
Last edited by WolfPack : Mar 28th, 2008 at 9:58 am. Reason: Added code tags. Use them when you post code.
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar backup blue gene breach business chips daniweb data data protection database development dos economy energy enterprise europe government hardware hp ibm ibm. news it linux medicine memory microsoft microsoft windows news open source openoffice pc ps3 recession red hat security server skype sun supercomputer supercomputing technology trends ubuntu vista updates voip windows update windows vista x86
- How to update database from checkboxes? (PHP)
- how to update database using mysql and jsp (JSP)
- database update using excell (Windows NT / 2000 / XP / 2003)
- To update database through gridview (ASP.NET)
- Update Database Problems (Visual Basic 4 / 5 / 6)
- ASP.Net VB Page to update a users profile not updating. (MS SQL)
- transferring database/data to internet. (MS SQL)
- database problem (C#)
- cant save to database (ASP)
- Send to Database Disabled (Windows Servers and IIS)
Other Threads in the VB.NET Forum
- Previous Thread: log in form
- Next Thread: I am confused and I need some help with VB.NET/SQL Server/ADO.NET



Linear Mode