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 (1443)
 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
 
what exception is thrown when you do a response.redirect IBM 2
What is the base class of .NET?   6
When is the ViewState available during the page processing cycle ?   6
Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?   1
How can you provide an alternating color scheme in a Repeater control?   1
can i inherit one web applications into another web applications in asp.net?   7
what is synchronization and asynchronization. what are the difference between two? TCS 1
Explain what a diffgram is and a good use for one? Syntax-Softtech 1
what are the oops concepts are used in your project?   1
when will garbage collector run?   1
can machine.config file orverrides web.config. For example: if u set session timeout as 30 mins in web.config file to a particular application and if u set session timeout as 10 mins in machin.config. what will happen and which session is set to the appliction? SunGard 2
Uses of CLR ? TCS 2
 
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