hi everyone, this is my first post here in the forums as im getting a little desperate on how to work things out. im a "returning programming student" after a 4 year lay off.
see, i have this very simple web form:
http://i279.photobucket.com/albums/kk137/wh3resmycar/faq.jpg
this webform is a component of a whole system that im working from the ground up, i wanted to ask you guys about this as i can not find a way to store the data from the textboxes (along with the date of posting) in to a database (mssql2005). as soon as i figure how this simple web form works, i can probably work on other web forms as well.
i would appreciate a simple review or some simple tutorials (most basic level preferably) on how this should work.
thanks.
Loading

Roei BarRank #1,271 · 1.4K reputationPosted Nov 1, 2009, 8:23 AM EST
static void Main(string[] args) { string SQL = "INSERT INTO Posts VALUES (txtSubject.Text, txtPostInfo.Text, txtEmail.Text, DateTime.Now.ToString())"; string ConnectionString ="Integrated Security=SSPI;Initial Catalog=Northwind;Data Source=localhost;"; using (SqlConnection conn = new SqlConnection("...")) using (SqlCommand cmd = conn.CreateCommand()) { try { cmd.CommandText = SQL; conn.Open(); cmd.ExecuteNoneQuery(); conn.Close(); } } finally { conn.Close(); } } // using statements ensure Disposed is called }and second option is to build a storedprocedure for the Insert and call it.
Mark Uy130 reputationPosted Nov 1, 2009, 4:06 PM EST
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 1, 2009, 4:10 PM EST