hello there... acctually i m creating a desktop application in vb.net so on the data insertaton page i had got an error that is "the ConnectionString property not initilized".. so i m posting all my code here... kindly help me..
Public Class Registration
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con_str As String = "Data Source=.\SQLEXPRESS;Initial Catalog=data;Integrated Security=True"
Dim cmd As New SqlCommand()
Dim con As New SqlConnection()
cmd.CommandText = "INSERT into reg(name,uname,pass,year,branch,scholar,email,add) values (@a,@b,@c,@d,@e,@f,@g,@h)"
cmd.Connection = con
cmd.Parameters.Add("@a", t1.Text)
cmd.Parameters.Add("@b", t2.Text)
cmd.Parameters.Add("@c", t3.Text)
cmd.Parameters.Add("@d", t4.Text)
cmd.Parameters.Add("@e", t5.Text)
cmd.Parameters.Add("@f", t6.Text)
cmd.Parameters.Add("@g", t7.Text)
cmd.Parameters.Add("@h", rt.Text)
Dim dd As New SqlDataAdapter(cmd)
Dim dst As New DataSet()
Using (dd)
dd.Fill(dst, "reg")
End Using
End Sub
End Class