TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sangeetha k
NA
207
51.3k
Sql exception caught correct me where iam going wrong
Sep 25 2017 4:06 AM
Procedure or function 'spDATA_UPDATE' expects parameter '@Phone', which was not supplied.
#database procedure
alter PROCEDURE [dbo].[spDATA_UPDATE]
@Phone as bigint,
@address as varchar(20),
@email_id as varchar(20)
AS
BEGIN
UPDATE Customer08_Details SET address=@address,email_id=@email_id , Phone=@Phone
END
GO
# dataacess layer
try
{
SqlConnection conn = new SqlConnection(constring);
conn.Open();
SqlCommand cmd = new SqlCommand("spDATA_UPDATE", conn);
cmd.Parameters.AddWithValue("@Phone", DbType.Int64).Value = Phone;
cmd.Parameters.AddWithValue("@email_id", DbType.String).Value = email_id;
cmd.Parameters.AddWithValue("@address", DbType.String).Value = Address;
adp = new SqlDataAdapter(cmd);
adp.Fill(dt);
conn.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return dt;
}
# business logic layer
public DataTable updateCustomerDetai(Int64 Phone, string email_id, string address)
{
DataTable dt = new DataTable();
dt = dal.updateCustomerDetails(Phone, email_id, address);
return dt;
}
#code behind of grid view
protected void gridView_Rowupdating(object sender,GridViewUpdateEventArgs e)
{
DataTable dt = new DataTable();
TextBox phone_no = gridView.Rows[e.RowIndex].FindControl("txtPhone") as TextBox;
long Phone = Convert.ToInt64(phone_no.Text);
TextBox Address = gridView.Rows[e.RowIndex].FindControl("txtAddress") as TextBox;
string address = Address.Text;
TextBox Email = gridView.Rows[e.RowIndex].FindControl("txtEmail") as TextBox;
string Email_id = Email.Text;
dt = bal.updateCustomerDetai(Phone, Email_id, address);
}
Reply
Answers (
2
)
how to create form 16B in come tax in asp.net c#
calling code behind function from javascript