Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to Insert a TextBox value in to Sql database using C#
coding?

Answer Posted / jeevananth

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you implement encapsulation in asp.net?

13054


Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?

985


Explain the use of fragment caching.

1101


What is the difference between page-level caching and fragment caching?

975


How many types cache in asp net?

1077


What is a web api? Which protocol is used in a web api?

1068


What is skin in asp.net?

959


How ASP and ASP.NET page works? Explain about asp.net page life cycle?

1040


What is the difference between cookie and session?

982


What is rich control in asp.net?

1022


What is server side routing?

922


What is a server farm in iis?

1043


Explain the boxing and unboxing concept in .net?

862


What are the disadvantages of view state?

1108


They mostly asked difference between versions of technologies

1389