i need to insert data into sql server table emp through
textboxes txtname and txtsalary using c# code. Please help
Answer / suresh
open the Sqlconnection and write the connection string dere
and take one sqldata Adapter and also take one datatable
write the following code.
sqlconnection con=new sqlconnection("server=.; user Id=sa;
Password=sa123; Database=emp");
sqlDataAdapter da;
DataTable dt;
In Button Click Event you write this code
da=new sqlDataAdapter("insert into Emp(EmpID,Ename) values
('"+textbox1.Text+"','"+textbox2.Text+"'",con);
dt=new DataTable();
da.Fill(dt);
That's it you entered the Data into SQL Server
Is This Answer Correct ? | 5 Yes | 1 No |
Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server
Define Abstract Class in C#
What does break do in loop?
What is strongly typed in c#?
What does the keyword virtual mean in the method definition?
Explain manifest in c#.
List the difference between interface and abstract class?
What is boxing in c#?
How do I port "synchronized" functions from visual j++ to c#?
What are the differences between system.string and system.text.stringbuilder classes?
Who benefits from ajax?
What is manifest ?