hi all
now guyz i add a info in datagrid view also displau now i hve some probelms that
when i create a update fuction in guestinfo table then the guest_id is autogenerte then can i delete through guest_id or not and it is also not updated
public void update()
{
guests abc = new guests();
{
string ConString = @"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=htm;Integrated Security=True";
SqlConnection con = new SqlConnection(ConString);
con.Open();
SqlCommand com = new SqlCommand("UpdateGUESTiNFO", con);
com.CommandType = CommandType.StoredProcedure;
in bcak the form of guestinfo code is
gst.update();
gst.First_name = first_name.Text.ToString();
gst.Last_name = last_name.Text.ToString();
gst.Phone_numb = Convert.ToInt32(phone_numb.Text);
gst.Email_address = email_id.Text.ToString();
stroe procedure is
create procedure UpdateGUESTiNFO
@GUEST_id INT,
@First_name nvarchar(50),
@last_name nvarchar(50),
@phone_number int,
@email_address nvarchar(50)
as
begin
update GuestInfo
set
first_name=@first_name,Last_name=@Last_name,Phone_number=@phone_number,Email_address=@Email_address
where
guest_ID=@Guest_ID
END