how save recoreed in the database

Answers were Sorted based on User's Feedback



how save recoreed in the database..

Answer / ajrun

Dim Query
Query="insert into TableName(username)values('" &
txt_username.text & "')"
Dim cmd as sqlclient.sqlcommand=new
sqlclient.sqlcommand(Query,connection)
cmd.ExecuteNonquery()

Is This Answer Correct ?    2 Yes 0 No

how save recoreed in the database..

Answer / vishnu

System.Data.SqlClient.SqlConnection sqlConnection1 =
new System.Data.SqlClient.SqlConnection("YOUR CONNECTION
STRING");

System.Data.SqlClient.SqlCommand cmd = new
System.Data.SqlClient.SqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText = "INSERT Region (RegionID,
RegionDescription) VALUES (5, 'NorthWestern')";
cmd.Connection = sqlConnection1;

sqlConnection1.Open();
cmd.ExecuteNonQuery();
sqlConnection1.Close();

Is This Answer Correct ?    1 Yes 0 No

how save recoreed in the database..

Answer / venky

string cns=@"server=.\SQLEXPRESS;Database=emp;Integrated Security=SSPI";

cn=new SqlConnection(cns);

string sql = "select * from mytable";
DataSet ds = new DataSet();
SqlDataAdapter adpt=new SqlDataAdapter(sql,cn);

adpt.Fill(ds,"emp1");

.....after altering table....

sqlcommandbuilder cbdr=new sqlcommandbuilder(adpt);

adpt.Update(ds,"emp1");

your changes automaically save into databases...

Is This Answer Correct ?    1 Yes 1 No

how save recoreed in the database..

Answer / y.gangi reddy

SqlConnection cn = new SqlConnection("user id=sa;pwd=xxx;database=yyy;data source=.");
SqlDataAdapter da = new SqlDataAdapter("select * from tablename", cn);
DataSet ds = new DataSet();
da.Fill(ds, "tablename");

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Dot Net WindowsForms Interview Questions

Are windows forms still used?

0 Answers  


How do I change the console application in windows?

0 Answers  


What are different options to store state in ASP.NET applications?

2 Answers   Arctern,


Which Isolation level is helps to read uncommitted data?

1 Answers   Arctern,


What is form and meaning?

0 Answers  






What are the different cloud platforms?

0 Answers  


What is difference between winforms and windows forms?

0 Answers  


how can u split a column header in gridview using C#.net

2 Answers   IBM,


Which is the global event handler for unhandled exceptions in an ASP.NET applications?

2 Answers   Arctern,


Extension methods can be both static and normal class methods. Yes/No?

1 Answers   Arctern,


What is the use of form?

0 Answers  


how to create a set up in vb.net for desktop application please say me steps with examples

1 Answers  


Categories