Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi all,

How to write the following code by using NHibernate:

SqlConnection con=new SqlConnection("Data Source=inndocs3;Initial Catalog=yvk;Persist Security Info=True;User ID=sa;Password=inndocs");
SqlCommand cmd=new SqlCommand();
cmd.Connection=con;
cmd.CommandText="insert into userinfo values('"+t1.Text+"','"+fileupload1.FileName+"')";
fileupload1.PostedFile.SaveAs(Server.MapPath(".") + "\\" + fileupload1.FileName);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
t1.Text = "";
Response.Write("<H1> File saved</H1>");


Please help me.
Thank you
Posted
Updated 19-Apr-11 21:47pm
v4
Comments
Dalek Dave 20-Apr-11 3:47am    
Edited for Grammar and Readability.

1 solution

 
Share this answer
 
Comments
Dalek Dave 20-Apr-11 3:47am    
Good Links
Prasanta_Prince 20-Apr-11 12:15pm    
Thank You Dalek Dave.
[no name] 20-Apr-11 3:52am    
Ah, the polite way of saying RTFM.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900