Click here to Skip to main content
15,891,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: resize the iframe Pin
dews turner1-Oct-09 0:24
dews turner1-Oct-09 0:24 
GeneralRe: resize the iframe Pin
Abhishek Sur1-Oct-09 0:29
professionalAbhishek Sur1-Oct-09 0:29 
GeneralRe: resize the iframe Pin
dews turner1-Oct-09 0:40
dews turner1-Oct-09 0:40 
GeneralRe: resize the iframe Pin
Abhishek Sur1-Oct-09 2:17
professionalAbhishek Sur1-Oct-09 2:17 
AnswerRe: resize the iframe Pin
Vasudevan Deepak Kumar1-Oct-09 1:20
Vasudevan Deepak Kumar1-Oct-09 1:20 
QuestionGlobal variable in c# Pin
JaganBR30-Sep-09 23:54
JaganBR30-Sep-09 23:54 
AnswerRe: Global variable in c# Pin
Paramhans Dubey1-Oct-09 0:02
professionalParamhans Dubey1-Oct-09 0:02 
Questionhow can u insert values in the database Pin
sumanmks30-Sep-09 23:53
sumanmks30-Sep-09 23:53 
hi i am very new to asp.net. It may be the simplest problem to u. but for me it is a bit difficult. I have written a code for inserting the values in the SQLEXPRESS in C#.but not able to insert it. Can Any one help me out. the code is as follows:


protected void Button1_Click1(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = @"Data Source=localhost\SQLEXPRESS;" +
"Initial Catalog=testdata;Integrated Security=SSPI";
try
{
myConnection.Open();
Label1.Text = "<b>Server Version:</b> " + myConnection.ServerVersion;
Label1.Text += "<br /><b>Connection Is:</b> " +
myConnection.State.ToString();
string insertSQL;
insertSQL = "INSERT INTO jobseekerinfo (";
insertSQL += "firstname, middlename, lastname, ";
insertSQL += "dob, address, city, state, zip, mobile, phone, engcollege, ";
insertSQL += "enguniversity, engaggergate, pucollege, puuniversity, pumarks,";
insertSQL += "school, scuniversity, scmarks, totalyears, totalmonths,";
insertSQL += "workplace, job, skills";
insertSQL += "VALUES ('";
insertSQL += TextBox1.Text + "', '";
insertSQL += TextBox2.Text + "', '";
insertSQL += TextBox3.Text + "', '";
insertSQL += TextBox29.Text + "', '";
insertSQL += TextBox5.Text + "', '";
insertSQL += TextBox11.Text + "', '";
insertSQL += TextBox12.Text + "', '";
insertSQL += TextBox14.Text + "', '";
insertSQL += TextBox6.Text + "', '";
insertSQL += TextBox15.Text + "', '";
insertSQL += TextBox4.Text + "', '";
insertSQL += TextBox8.Text + "', '";
insertSQL += TextBox9.Text + "', '";
insertSQL += TextBox10.Text + "', '";
insertSQL += TextBox30.Text + "', '";
insertSQL += TextBox31.Text + "', '";
insertSQL += TextBox32.Text + "', '";
insertSQL += TextBox33.Text + "', '";
insertSQL += TextBox34.Text + "', '";
insertSQL += TextBox35.Text + "', '";
insertSQL += TextBox36.Text + "', '";
insertSQL += TextBox18.Text + "', '";
insertSQL += TextBox19.Text + "', '";
insertSQL += TextBox20.Text + "', '";
insertSQL += "')";
SqlCommand cmd = new SqlCommand(insertSQL, myConnection);
int added = 0;
added = cmd.ExecuteNonQuery();
Label1.Text = added.ToString() + " records inserted.";
}

finally
{
myConnection.Close();
Label1.Text += "<br /><b>Connection Is:</b> " +
myConnection.State.ToString();

}
}

Thanks in advance
AnswerRe: how can u insert values in the database Pin
J4amieC30-Sep-09 23:59
J4amieC30-Sep-09 23:59 
GeneralRe: how can u insert values in the database Pin
Abhijit Jana1-Oct-09 0:04
professionalAbhijit Jana1-Oct-09 0:04 
GeneralRe: how can u insert values in the database Pin
sumanmks1-Oct-09 0:08
sumanmks1-Oct-09 0:08 
AnswerRe: how can u insert values in the database Pin
Abhijit Jana30-Sep-09 23:59
professionalAbhijit Jana30-Sep-09 23:59 
AnswerRe: how can u insert values in the database Pin
Abhishek Sur1-Oct-09 0:07
professionalAbhishek Sur1-Oct-09 0:07 
GeneralRe: how can u insert values in the database Pin
sumanmks1-Oct-09 0:12
sumanmks1-Oct-09 0:12 
GeneralRe: how can u insert values in the database Pin
Abhishek Sur1-Oct-09 0:15
professionalAbhishek Sur1-Oct-09 0:15 
GeneralRe: how can u insert values in the database Pin
sumanmks1-Oct-09 0:53
sumanmks1-Oct-09 0:53 
RantRe: how can u insert values in the database Pin
Greg Chelstowski1-Oct-09 0:15
Greg Chelstowski1-Oct-09 0:15 
JokeRe: how can u insert values in the database Pin
Abhishek Sur1-Oct-09 0:30
professionalAbhishek Sur1-Oct-09 0:30 
AnswerRe: how can u insert values in the database Pin
Vasudevan Deepak Kumar1-Oct-09 1:22
Vasudevan Deepak Kumar1-Oct-09 1:22 
AnswerRe: how can u insert values in the database Pin
hemant.kaushal2-Oct-09 2:52
hemant.kaushal2-Oct-09 2:52 
QuestionThe request failed with HTTP status 401: Unauthorized. Pin
Calla30-Sep-09 23:48
Calla30-Sep-09 23:48 
QuestionUrl rewrite Pin
Ramkumar_S30-Sep-09 23:38
Ramkumar_S30-Sep-09 23:38 
AnswerRe: Url rewrite Pin
Abhishek Sur30-Sep-09 23:45
professionalAbhishek Sur30-Sep-09 23:45 
GeneralRe: Url rewrite Pin
Ramkumar_S30-Sep-09 23:57
Ramkumar_S30-Sep-09 23:57 
GeneralRe: Url rewrite Pin
Abhishek Sur1-Oct-09 0:02
professionalAbhishek Sur1-Oct-09 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.