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
john kanyora
NA
242
45.5k
stored procedure to retrieve data from radiobutton to table
Feb 27 2018 2:47 AM
kindly help on how i can implement a stored procedure on the code behind that once i use my radiobutton it loads the data to the table sms_outbox.
i have created the stored procedure below but once i implement in the code behind it does not work.this is my code behind;
protected void radioButton1_CheckedChanged(Object sender, EventArgs e)
{
SqlCommand SqlCmd = new SqlCommand();
SqlCmd.CommandText = "[enterprise].[send_sms]";
SqlCmd.CommandType = CommandType.StoredProcedure;
SqlCmd.Parameters.Add("@CompanyID", SqlDbType.NVarChar).Value = CompanyID;
SqlCmd.Parameters.Add("@BranchID", SqlDbType.NVarChar).Value = BranchID;
SqlCmd.Parameters.Add("@DepartmentID", SqlDbType.NVarChar).Value = DepartmentID;
SqlCmd.Parameters.Add("@EmployeeMobilePhone", SqlDbType.NVarChar).Value = EmployeeMobilePhone;
SqlCmd.Parameters.Add("@VendorPhone", SqlDbType.NVarChar).Value = VendorPhone;
SqlCmd.Parameters.Add("@PatientCellPhone", SqlDbType.NVarChar).Value = PatientCellPhone;
}
this is my stored procedure
Create PROCEDURE [enterprise].[send_sms]
(
@CompanyID NVARCHAR(72),
@BranchID NVARCHAR(36),
@DepartmentID NVARCHAR(36),
@Value nvarchar(36)=''
)
AS
DECLARE @EmployeeName nvarchar(36)
DECLARE @EmployeeMobilePhone nvarchar(36)
DECLARE @VendorName nvarchar(36)
DECLARE @VendorPhone nvarchar(36)
DECLARE @PatientName nvarchar(36)
DECLARE @PatientCellPhone nvarchar(36)
BEGIN
IF @Value='Patients'
BEGIN
insert into sms_outbox(CompanyID,BranchID,DepartmentID,Recipient)
select CompanyID,BranchID,DepartmentID,PatientCellPhone from CustomerInformation
END
ELSE IF @Value='Suppliers'
BEGIN
insert into sms_outbox(CompanyID,BranchID,DepartmentID,Recipient)
select CompanyID,BranchID,DepartmentID,VendorPhone from VendorInformation
END
this is my aspx page with the radiobutton defined
<asp:RadioButtonList ID="Radiobuttonlist1" OnCheckedChange="Radiobuttonlist1_CheckedChange" runat="server">
<asp:ListItem Text="Patients" Value="Patients"></asp:ListItem>
<asp:ListItem Text="Suppliers" Value="Suppliers"></asp:ListItem>
<asp:ListItem Text="Employees" Value="Employees"></asp:ListItem>
</asp:RadioButtonList>
Reply
Answers (
9
)
passing method to instance with out creating objeect
how do i Bind the dynamic controls on a buttonClick without