ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Microsoft Related >> ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions (615)
 C Sharp interview questions  C Sharp Interview Questions (722)
 ASP.NET interview questions  ASP.NET Interview Questions (1444)
 VB.NET interview questions  VB.NET Interview Questions (150)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (199)
 IIS interview questions  IIS Interview Questions (86)
 MTS interview questions  MTS Interview Questions (5)
 Crystal Reports interview questions  Crystal Reports Interview Questions (62)
 BizTalk interview questions  BizTalk Interview Questions (33)
 Dot Net interview questions  Dot Net Interview Questions (861)
 Exchange Server interview questions  Exchange Server Interview Questions (103)
 SharePoint interview questions  SharePoint Interview Questions (25)
 WCF interview questions  WCF Interview Questions (8)
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions (193)
Question
How to Insert a TextBox value in to Sql database using C#
coding?
 Question Submitted By :: ASP.NET
I also faced this Question!!     Answer Posted By  
 
Answer
# 11
SqlConnection con = new SqlConnection();

con.ConnectionString = "data source=anand\\sqlexpress.
initial catalog=Database1;integrated security=sspi;";

SqlCommand myCommand = new SqlCommand();

myCommand.CommandText = "Insert into
usr(firstname,lastname,dob,phno,email,Address,state,bgroup)
Values('" + firstname.Text + "','" + lastname.Text + "'," +
dob.Text + "," + phno.Text + ",'" + email.Text + "','" +
Address.Text + "','" + state.Text + "','" + bgroup.Text + "')";

myCommand.Connection = con;

con.Open();

myCommand.ExecuteNonQuery();

con.Close();
 
Is This Answer Correct ?    5 Yes 4 No
Anand
 
Answer
# 12
string strconn = @"Data Source=localhost;
Initial Catalog=Bala;
Trusted_Connection=yes;";
SqlConnection conn = new SqlConnection(strconn);
conn.Open();
string insertcommand = "insert into Employee
values('" + TextBox1.Text + "','" + TextBox2.Text + "','" +
TextBox3.Text + "')";
SqlCommand cmd = new SqlCommand(insertcommand, conn);
cmd.ExecuteNonQuery();
conn.Close();
 
Is This Answer Correct ?    3 Yes 2 No
Balakumar
 
Answer
# 13
How to Insert two TextBoxs values in to one column sql database using C# coding 
Is This Answer Correct ?    0 Yes 0 No
Surendra
 
Answer
# 14
insertBox("(Text1.Text)")+("(Text1.Text)"); 
Is This Answer Correct ?    0 Yes 0 No
Thualsi
 
Answer
# 15
almost all the posted answers above are correct(85%). 
Is This Answer Correct ?    3 Yes 4 No
Mmm
 
Answer
# 16
c# question in type 
Is This Answer Correct ?    0 Yes 4 No
Ghanshyam Verma
 
Answer
# 17
try
{
SqlConnecion cn=new SqlConnection("Data
source=.;database=Studentdetail;uid=sa;pwd=sa");
SqlCommand cmd=new SqlCommand();
cn.Open();
string qry;
qry="insert into Table values('"+ TextBox1.Text +"','"+
TextBox2.Text +"')";
cmd=new(qry,cn);
cmd.cmd.ExecuteNonQuery();


cn.Close();
}
catch(Exception ex)
{
Responce.Write(ex.Message.ToString());
}
 
Is This Answer Correct ?    0 Yes 6 No
Jeevananth
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
how can you bind data from dataset to XML file LG-Soft 2
What are the major differences between asp.net1.1 and asp.net 2.0? CTS 8
How to do Caching in ASP?   1
which event in global.asx that fires for every request of same user? FactorH 4
if u r projet consist of 4 people means how can u manage the file Mind-Tree 10
What is difference between masterpage and user control, what is the objective of master page when we had user control in .NET 1.1 version DELL 3
What is three major points in WCF? Patni 1
AJAX - explain the concept and some controls like update panel, tabcontrol etc Syntel 2
What is the difference between response.redirect and server.transfer, how to choose one among the other? 247Customer 3
Difference between Response.Expires and Expires.Absolute ? Accenture 1
What are typed datasets? IBS 1
What r new things introduced in ASP.NET 2.0 in comparision to ASP.NET 1.1   1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com