helo

what is the right coding to link my databse(sysbase) to vb.net?and how to insert the txt box value into database table value?the problem is when i put the

Insert into ad_Report values("' + txtName  + "',"'')

as example into the coding,it wont appear in database and error will display on my website,i got 8 tables in ad_Report but i just want to fill only one or two tables,i dont know the coding because im still newbie in this language and all this

thank you for everyone help

this is my code,i've try many time until my head want to blow off

Imports System.Data.SqlClient


Partial Class _Default
    Inherits System.Web.UI.Page
    Public row As Integer
    Public myArray(200, 200) As String

    Protected Sub btn_hantar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_hantar.Click
        Dim SQLConn As New System.Data.Odbc.OdbcConnection 'The SQL Connection
        Dim SQLCmd As New System.Data.Odbc.OdbcCommand 'The SQL Command
        Dim SQLStr As String
        Dim ConnString As String

        SQLConn.ConnectionString = "Data Source=efas1.usm.my,4000;Initial Catalog=jbend_db;Integrated Security=True"
        SQLConn.Open()
        SQLCmd.Connection = SQLConn
        SQLCmd.CommandText = SQLStr = "INSERT Into ad_AduanHdr VALUES ('" + txt_Kategori.Text + "','" + txt_NoId.Text + "','" + txt_Nama.Text + "','" + txt_Email.Text + "','" + txt_NoTelefon.Text + "'," + txt_NoTelefonBimbit.Text + "','" + txt_Add1.Text + "','" + txt_Add2.Text + "','" + txt_Poskod.Text + "','" + txt_Bandar.Text + "','" + ddl_Negeri.SelectedValue + "','" + ddl_Negara.SelectedValue + "','" + txt_Tajuk.Text + "','" + txt_AduanArea.Text + "','" + rb_JenisAduan.SelectedItem + "','" + txt_Tarikh.Text + "','" + txt_Tarikh.Text + "','" + txt_Kategori.Text + "')"
        SQLCmd.ExecuteNonQuery()

        SQLConn.Close()

    End Sub
End Class

the error that come out is Error 1 Operator '+' is not defined for types 'String' and 'System.Web.UI.WebControls.ListItem'. c:\inetpub\wwwroot\aduanhdr\Default.aspx.vb 18 39 [url]http://localhost/aduanhdr/[/url]

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.