Skip to main content

Posts

Showing posts with the label Create table runtime using c sharp code

Create table runtime using c sharp code

Create table runtime using c sharp code try { if (RadioButton1.Checked == true) { string first = TextBox1.Text.ToString(); string last = TextBox3.Text.ToString(); string user = TextBox4.Text.ToString(); string ps = TextBox6.Text.ToString(); string quest = DropDownList1.Text.ToString(); string answ = TextBox7.Text.ToString(); string source = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\dfd.mdf;Integrated Security=True; User Instance=True"; SqlConnection conn = new SqlConnection(source); conn.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO users(fname, lname, uid, pswd, ques, ans) VALUES ('" + first + "', '" + last + "', '" + user + "', '" + ps + "', '" + quest + "', '" + answ + "')", conn); int i = cmd.ExecuteNonQuery(); String sql = "CREATE TABLE " + user + "" +"(Stu