asp.net - Add information to table with linq and stored procedure at architecture 3layers -
i use stored procedures , linq in project. want insert information users code?
i write website 3 layers architecture.
my code @ bll layer
public class account { #region private account private int _id; private string _name; private string _family; private string _email; private string _tel; private string _username; private string _password; #endregion #region public property public int id { { return _id; } set { _id = value; } } public string name { { return _name; } set { _name = value; } } public string family { { return _family; } set { _family = value; } } public string email { { return _email; } set { _email = value; } } public string tel { { return _tel; } set { _tel = value; } } public string usernamr { { return _username; } set { _username = value; } } public string password { { return _password; } set { _password = value; } } #endregion #region public method carddatacontext db = new carddatacontext(); public void insertaccount() { db.insertaccount(_name, _family, _email, _tel, _username, _password); system.windows.forms.messagebox.show(" اطلاعات با موفقیت درج شد "); } #endregion }
my code insert button
protected void button1_click(object sender, eventargs e) { account account=new account(); account.name = textbox1.text; account.family = textbox2.text ; account.email = textbox3.text ; account.tel = textbox4.text ; account.usernamr = textbox5.text; account.password = textbox6.text; account.insertaccount();
my project error is
throw new notimplementedexception();
my stored procedure is:
create procedure [dbo].[insertaccount] ( @name nvarchar(50), @family nvarchar(50), @email nvarchar(50), @tel nvarchar(50), @username nvarchar(50), @password nvarchar(50) ) set nocount on insert account (name, family, email, tel, username, password) values (@name, @family, @email, @tel, @username, @password) return
how , add insert account method?
this insert account method :
public void insertaccount() { db.insertaccount(_name, _family, _email, _tel, _username, _password); system.windows.forms.messagebox.show(" اطلاعات با موفقیت درج شد "); }
i add insert account method. what's problem project?
please me.
right click on insertaccount(); , "go definition"
if there no definition, meaning there no method name, you'll need create it.
Comments
Post a Comment