I was wondering if someone can maybe help me
Im creating a web application called spaudit, and i was wondering how to save checkboxes'es text into database..
I got a form where I can add an Auditor from a specific listbox that gets all the auditors from a specific table in the database..
Then I got a listbox underneath it where I have to select a Service provider which I also get from another table in the database..
And then I have a calender where I select a audit date, and time.
Now when I click save, all the data saves into their tables and its working just the way I want it to work.. But now I inserted checkboxes with like 10 different companies, and I created another table in the database which has 2 colomns 1. int_ServiceProviderId and 2.nv_Company.
I want the program to work like this,
I select an Auditor, a service provider, a date and time then
I need to click on a few companies that the specific service provider that I have chosen from the dropdownlistbox that the service provider supports...
Just say I want 2 from the 10 checkboxes..
Now I want the program to save the checkboxes(Companies) that is checked into the tblCompanies table... It must save the ServiceproviderId and Company..
What will the stored procedure and the physical code look like..this is how the other looks like
protected void btnSave_Click(object sender, EventArgs e)
{
audit = new Audits();
Companies = new ServiceProviderCompanies();
SQLDAL sqlData = new SQLDAL();
User user = (User)Session["User"];
if (Request.QueryString["id"] != null)
audit.ScheduleId = int.Parse(Request.QueryString["id"].ToString());
else
audit.ScheduleId = 0;
audit.ServiceProviderId = int.Parse(listServiceProvider.SelectedValue.ToString());
audit.AuditorId = int.Parse(listAuditor.SelectedValue.ToString());
audit.AuditDate = tbAuditDate.Text;
audit.AuditTime = time2.Value.ToString();
audit.InsertUser = user.UserName.ToString();
sqlData.UpdateSingleAudit(audit);
if (sqlData.ErrorNumber > 0)
Response.Write(sqlData.ErrorMessage);
else
Response.Write("<script>window.close()</script>");
sqlData = null;
}
Please help me with it anyone...
I will appreciate it:)

New Topic/Question
Reply




MultiQuote


|