hi frnds i m doing the project in vb.net
in which i want 2 add data in database i took two lebel boxes
and two textbox and i want data should add in database on button click
so i tried it in to microsoft access just normal table which contens 2
coloums both contens text and my coding is as below but not running proparly
is this becoz of version problem i dont no so suggest me code
error is like
Error 1 Name 'NameTextbox' is not declared. D:\Documents and Settings\dheeraj\Local Settings\Application Data\Temporary Projects\insert value userdefine\Form1.vb 11 21 insert value userdefine

Error 2 Name 'designTextbox' is not declared. D:\Documents and Settings\dheeraj\Local Settings\Application Data\Temporary Projects\insert value userdefine\Form1.vb 12 21 insert value userdefine

Imports System.Data.OleDb
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim conn As New OleDbConnection("provider=Microsoft.jet..OLEDB.4.0;data source=D:\Documents and Settings\dheeraj\My Documents\project.mdb")
        Dim adapter As New OleDbDataAdapter("select * from project", conn)
        Dim ds As New DataSet
        adapter.Fill(ds)
        Dim builder As New OleDbCommandBuilder(Adapter)
        Dim newrow As DataRow = ds.Tables(0).NewRow
        newrow(5) = NameTextbox.text
        newrow(6) = designTextbox.text
        ds.Tables(0).Rows.Add(newrow)
        Adapter.Update(ds)


    End Sub
End Class

@Dheerajpro

Please read forum rules. Do wrap your programming code blocks within [code] ... [/code] tags.

>Error : Name 'NameTextbox' is not declared.

Open the Form1 and verify the name property of textboxes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.