locked
My Query Is to store my information in Database Using Microsoft Visual Basic.Net 2010 RRS feed

  • Question

  • By this below code i am not able to store information

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
            {

            SqlConnection(con = New SqlConnection())
            con.ConnectionString = "Data Source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\SYSangha.mdf;User Instance=true"
            con.Open()
            SqlCommand(cmd = New SqlCommand())
            cmd.Connection = con
            cmd.CommandType = CommandType.Text

            cmd.CommandText = "insert into New_Member(M_Name,M_Mobile_No,M_Age,M_Blood,M_Address,M_Email,M_pwd) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "')"


            cmd.ExecuteNonQuery()
            Label2.Text = "success"

            con.Close()

        End Sub

          
    Sunday, January 26, 2014 3:10 PM

All replies

  • The real code monkeys are over on the asp.net forum

    Post your code there, you are virtually guaranteed that someone will look through it and tell you what is wrong.

    This forum you can get a limited amount of asp.net assistance.



    ClarkNK, A.K.A. HomePage Doctor
    HomePageDoctor.com -- Database Tutorials
    Ownertrades.com -- Created with Expression, VWDExress, SQL Express, and ASP.NET
    Arvixe -- My favored web host

    Monday, January 27, 2014 2:10 PM