Urgent Help on C#~~
-
Hi everyone.. I'm currently doing a web application using C# which i'm unfamiliar with the prgram. I need urgent help~ My problem is that if i retrieve the database, how can i select, edit or delete the particulars from the database which i select? Anyone who know how to code it?? I have tried several times and it seem like is not right.. Your help is greatly appreciated.. Thankz.. =) Cheers!
-
Hi everyone.. I'm currently doing a web application using C# which i'm unfamiliar with the prgram. I need urgent help~ My problem is that if i retrieve the database, how can i select, edit or delete the particulars from the database which i select? Anyone who know how to code it?? I have tried several times and it seem like is not right.. Your help is greatly appreciated.. Thankz.. =) Cheers!
-
Hi everyone.. I'm currently doing a web application using C# which i'm unfamiliar with the prgram. I need urgent help~ My problem is that if i retrieve the database, how can i select, edit or delete the particulars from the database which i select? Anyone who know how to code it?? I have tried several times and it seem like is not right.. Your help is greatly appreciated.. Thankz.. =) Cheers!
Good morning Write a method like the below to populate the form // could be global private string strErrorMsg = "Database error: " + exp.Message; try { SqlConnection conn = new SqlConnection(put your connection string hear); strSQL = "SELECT * FROM theNameOftheTable"; SqlCommand cmd = new SqlCommand(strSQL, conn); cmd.CommandType = CommandType.Text; SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds); // a method to display the information, is this a grid or form with textboxes? conn.Close(); cmd.Dispose(); conn.Dispose(); } catch { //some message about the error strErrorMsg; }