Wednesday, November 11, 2009

AddNews.aspx !!

Relation Between Insert Procedura and Page ;

Sql cmd =new SqlCommand ("insNews", Sqlcon)
Sqlcmd.CommandType=CommandType.StoreProcedure;
Sqlcmd.Parameters.AddWithVales("@headline",txtHeadline.Text);

string strtxtdate=txtDate.Text.Substring(3,2)+ "/" + txtDate.Text.Substring(0,2)+ "/" + txtDate.Text.Substring(6,4);

Sqlcmd.Parameters.Addwithvalue("@date",strtxtdate.ToString());

Sqlcmd.Parameters.Addwithvale("@active","");
Sqlcmd.Parameters.Addwithvalue("@delete","");

strImage=System.IO.Path.GetFileName(uploadImage.Post.PostedFile.fileName);

string savelocation= server.Mathpath("upload")+ "\" strImage;

uploadImage.Postfile.SaveAs(Savelocation);

Sqlcmd.Paremeters.Addwithvales("@image", stringImage.Tostring());

No comments: