i want if caseid , pin and mobile is available in database table then its shows "success" otherwise "error" . i am using stored procedure to check and asp.net webform for backend..below is the code
Stored Proc
create PROCEDURE [dbo].[usp_Download_report]
@CaseID nvarchar(50),
@Pin nchar(6),
@MobileNo nvarchar(12)
AS
BEGIN
Declare @CountR int
Select @CountR=count(*) from [MedleaprLAB].[dbo].[reportdownloadpin] where CaseID=@CaseID and Pin=@Pin
end
aspx page
aspx.cs
protected void btnsubmit_Click(object sender, EventArgs e)
{
fill_downloadreport();
}
protected void fill_downloadreport()
{
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_Download_report";
cmd.Parameters.AddWithValue("@CaseID", txtcaseid.Text.Trim());
cmd.Parameters.AddWithValue("@MobileNo", txtmobileno.Text.Trim());
cmd.Parameters.AddWithValue("@Pin", txtpin.Text.Trim());
int result = db.DmlQuery(cmd, "Databsename");
if (result == 1)
{
lblmsg.Text = result.ToString();
}
else
{
lbl_msg.Text = result.ToString();
}
}
Amit MohantyPosted Aug 4, 2022, 4:28 AM
Guest UserPosted Aug 4, 2022, 5:31 AM