need help urgent (how to done connectivity with database)
-
Hi friends i have done following coding for making a simple guestbook.where i define Name,Email , Location and meesage . I want to store all the values in database when i click on button . i dont know how to do this . coz im new in programming. plz reply me on manvikaur2@gmail.com. if anyone knows . ---------------------------------------------------------------------------- Guestbook.NET
Name:
E-mail:
Location:
Message:
---------------------------------------------------------------------------- i try to connect with SQL server 2005 after creating the table. but not able to done this .
-
Hi friends i have done following coding for making a simple guestbook.where i define Name,Email , Location and meesage . I want to store all the values in database when i click on button . i dont know how to do this . coz im new in programming. plz reply me on manvikaur2@gmail.com. if anyone knows . ---------------------------------------------------------------------------- Guestbook.NET
Name:
E-mail:
Location:
Message:
---------------------------------------------------------------------------- i try to connect with SQL server 2005 after creating the table. but not able to done this .
jasjit 007 wrote:
i try to connect with SQL server 2005 after creating the table. but not able to done this .
Why ? What problem are you getting ? Did you tried with google ?
cheers, Abhijit
-
Hi friends i have done following coding for making a simple guestbook.where i define Name,Email , Location and meesage . I want to store all the values in database when i click on button . i dont know how to do this . coz im new in programming. plz reply me on manvikaur2@gmail.com. if anyone knows . ---------------------------------------------------------------------------- Guestbook.NET
Name:
E-mail:
Location:
Message:
---------------------------------------------------------------------------- i try to connect with SQL server 2005 after creating the table. but not able to done this .
-
:(( hi sir , i think u r not understanding the prob.i want to make a assignemt . when i click on button all the data will be store in SQL sever 2005 . i have created the web.config file where i define the connection string. now how to define the table.but im not able to do this .plz run the code in microsoft visual studio if u have Thanks Jasjit
-
jasjit 007 wrote:
i try to connect with SQL server 2005 after creating the table. but not able to done this .
Why ? What problem are you getting ? Did you tried with google ?
cheers, Abhijit
hi sir , i think u r not understanding the prob.i want to make a assignemt . when i click on button all the data will be store in SQL sever 2005 . i have created the web.config file where i define the connection string. now how to define the table.but im not able to do this .plz run the code in microsoft visual studio if u have Thanks Jasjit
-
Hi friends i have done following coding for making a simple guestbook.where i define Name,Email , Location and meesage . I want to store all the values in database when i click on button . i dont know how to do this . coz im new in programming. plz reply me on manvikaur2@gmail.com. if anyone knows . ---------------------------------------------------------------------------- Guestbook.NET
Name:
E-mail:
Location:
Message:
---------------------------------------------------------------------------- i try to connect with SQL server 2005 after creating the table. but not able to done this .
-
Hi nidhi , im sending u code for connectivey. plz tell me whr is the prob . i want to submit all the data in databse when i click on button . i define web.config .but prob is not solved. public partial class _Default : System.Web.UI.Page { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); SqlCommand cmd = new SqlCommand(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { conn.Open(); cmd.Connection = con; cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)"; }
-
Hi nidhi , im sending u code for connectivey. plz tell me whr is the prob . i want to submit all the data in databse when i click on button . i define web.config .but prob is not solved. public partial class _Default : System.Web.UI.Page { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); SqlCommand cmd = new SqlCommand(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { conn.Open(); cmd.Connection = con; cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)"; }
Could you pls send me web.config code also,one more thing is there have u debug ur code,i think when u'll click on button it will not go to your this event: protected void Button1_Click(object sender, EventArgs e) { conn.Open(); cmd.Connection = con; cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)"; } pls debug ur code and then let me know that ur debugger is going to this event or not.
-
Could you pls send me web.config code also,one more thing is there have u debug ur code,i think when u'll click on button it will not go to your this event: protected void Button1_Click(object sender, EventArgs e) { conn.Open(); cmd.Connection = con; cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)"; } pls debug ur code and then let me know that ur debugger is going to this event or not.
-
You r trying to fetching connectino from web.config using this code : SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); but you have not define connection in web.config. please write this code in your web.config and update :you sql server name, your database name,userid for accessing database,password for accessing database