Tuesday, July 14, 2009

Need C# code for inserting new rows into database in asp.net website?

The insert function is in a class and called from default.aspx the function definition is as follows:





public bool RegisterNewMember(string UserID, string Password, string MemberType, string Campus, string MemberName, string Email)


{


//Not quite sure what the code should be here


}

Need C# code for inserting new rows into database in asp.net website?
sSQL = string.Format("Insert into myTable Values ({0}, {1},{2}, {3},{4}, {5})",UserID, Password, MemberType, Campus, MemberName, Email);


try


{


dbcmd = new MySqlCommand(sSQL, dbcon);


dbcmd.ExecuteNonQuery();


}


catch (MySqlException exInsert)


{


}


finally


{


}
Reply:check out http://www.pscode.com for great sample codes
Reply:Hi watch the video #13 found: http://msdn.microsoft.com/vstudio/expres...


This covers everything you'll need to know in C#, so much info,:


If you need a refresher on queries watch video's 8 and 9


http://msdn.microsoft.com/vstudio/expres...





Lastly, think of joining: http://forums.asp.net/default.aspx


for more technical help from the users of asp.net

baseball cards

No comments:

Post a Comment