Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

why am I getting this error

$
0
0

This is my code that I am getting the error on, I think its my curly braces, Please look at it and advise.. The void next to protected and thecurly brace afterwards.......Thanks

        }

       protectedvoid Submit_Click(object sender, EventArgs e)

}

      privatevoid ExecuteInsert(string firstname,string Lastname, string email, string username, string gender, string age, string address)

        SqlConnection conn =new SqlConnection((@"Data Source=CLIFF-PC\SQLEXPRESS;Initial Catalog=Customer;Integrated Security=True"());

       string sql = "INSERT INTO CustSecurity(CustId, CustFirstName, CustLastName, CustEmail, CustGender, Custage, UserPassword) VALUES "                  +

" (@FirstName,@LastName,@Email,@Gender,@Age,@Address)";

   }

       try

        {

            conn.Open();

            SqlCommand cmd =

new SqlCommand(sql, conn);

            SqlParameter[] param =

new SqlParameter[6];

           

//param[0] = new SqlParameter("@id", SqlDbType.Int, 20);

            param[0] =

new SqlParameter("@FirstName", SqlDbType.VarChar, 50);

            param[1] =

new SqlParameter("@LastName", SqlDbType.VarChar, 50);

            param[2] =

new SqlParameter("@Email", SqlDbType.VarChar, 50);

            param[3] =

new SqlParameter("@Gender", SqlDbType.Char, 10);

            param[4] =

new SqlParameter("@Age", SqlDbType.Int, 100);


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>