I created stored procedure for retrieve data by Id in sql server
- Create procedure [dbo].Retrievebyid(@ID int) as begin
- select [Name],
- [Manufacturer],
- [Model]
- from HardwareDbTable where AssetID=@ID end
Now goto visual studio create project and take web-aplication in that added ADO.NET EntityModel.
And i try to call that SP but i don't know how do it.
- Entities db = new Entities();
- void Edit()
- {
- str = Convert.ToInt16(Request.QueryString["id"]);
- db.Edit_Hwdb(ID: str);
- Edit_Hwdb_Result dbb = new Edit_Hwdb_Result();
- TextBox1.Text = dbb.AssetName;
- TextBox2.Text = dbb.Manufacturer;
- TextBox3.Text = dbb.Model;
- }
but its not retieving any data.