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 (614)
 C Sharp interview questions  C Sharp Interview Questions (721)
 ASP.NET interview questions  ASP.NET Interview Questions (1442)
 VB.NET interview questions  VB.NET Interview Questions (150)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (198)
 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 :: Mail2ssuresh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
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
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 12
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
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 13
c# question in type 
Is This Answer Correct ?    0 Yes 4 No
Ghanshyam Verma
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 14
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
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 15
almost all the posted answers above are correct(85%). 
Is This Answer Correct ?    3 Yes 4 No
Mmm
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 16
How to Insert two TextBoxs values in to one column sql database using C# coding 
Is This Answer Correct ?    0 Yes 0 No
Surendra
 
  Re: How to Insert a TextBox value in to Sql database using C# coding?
Answer
# 17
insertBox("(Text1.Text)")+("(Text1.Text)"); 
Is This Answer Correct ?    0 Yes 0 No
Thualsi
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
How To Send Value one page to Another Page On MasterMenu Click ? please Tell Me!   1
Which of the following hosts Can't be used to create .net Application? a) IIS b) Internet Explorer c) ASP.Net d) Windows Shell Which one is correct? CTS 1
What are PDBs? Where must they be located for debugging to work?   4
Using Statement usage in C#   2
What is the use of The Page.Master Property?   1
Name the control which can be used to reserve the space on web page for storing localized data. IBM 3
How can we prevent an aspx page get refreshed when any information fetch from the database ? Minecode 2
what is CTS? PrimeLine 3
how to do pakaging nd deployment   1
i have a register form & in that form i have a 2 textboxes for entering name&age.my doubt is that how can i provide error message like "invalid entry" when user enter a invalid name/age(eg:user enter name as #%%%##daff,and age as 1000.)in that textboxes.I want code.   2
Types of object in asp ? Accenture 1
can any one explain about 3-tier architecture and how to deploy 3 layers of 3-tier architecture in 3 different servers.plz send me .net code Wipro 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