Eswar Datta

Eswar Datta

  • 1.8k
  • 115
  • 3.1k

Entity frame work

Sep 4 2018 7:25 AM
I created stored procedure for retrieve data by Id in sql server
  1. Create procedure [dbo].Retrievebyid(@ID intas begin  
  2. select [Name],  
  3. [Manufacturer],  
  4. [Model]  
  5. 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.
  1. Entities db = new Entities();  
  2. void Edit()  
  3. {  
  4. str = Convert.ToInt16(Request.QueryString["id"]);  
  5. db.Edit_Hwdb(ID: str);  
  6. Edit_Hwdb_Result dbb = new Edit_Hwdb_Result();  
  7. TextBox1.Text = dbb.AssetName;  
  8. TextBox2.Text = dbb.Manufacturer;  
  9. TextBox3.Text = dbb.Model;  
  10. }  
but its not retieving any data.

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (8)