Creating a new row.
-
Hi Please advise me how to enter a new row in Microsoft Access Database by using vb.net. regards adil
R u kidding asking such a question in this forum...You shud first search that into google or any other search engine, then try it yourself and if you are facing any problem then post it here so that we can help you out. We are not here for spoon feeding. please avoid such stuff in future. Mubashir
Every job is a self portrait of the person who did it.
-
R u kidding asking such a question in this forum...You shud first search that into google or any other search engine, then try it yourself and if you are facing any problem then post it here so that we can help you out. We are not here for spoon feeding. please avoid such stuff in future. Mubashir
Every job is a self portrait of the person who did it.
hi dear I tried to find a lot ...as i am new to vb.net therefore suffering to solve my problem. I used following code to retrive data.. Now i want to insert...but unable to do so... Imports System.Data.OleDb Public Class Form1 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader Private Sub Form1_Load(ByVal sender As System.Object, ByVal e as _ System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_ System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;_ Data Source=C:\emp.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from table1", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) ' loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class regards adil
m.adil.farooq mcs & acca adil-farooq@maktoob.com
-
hi dear I tried to find a lot ...as i am new to vb.net therefore suffering to solve my problem. I used following code to retrive data.. Now i want to insert...but unable to do so... Imports System.Data.OleDb Public Class Form1 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader Private Sub Form1_Load(ByVal sender As System.Object, ByVal e as _ System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_ System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;_ Data Source=C:\emp.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from table1", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) ' loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class regards adil
m.adil.farooq mcs & acca adil-farooq@maktoob.com