I looked at your suggestion for checkboxlist. I want to do the same in Vb and tried using developer fusion but it most of the times it shows EOF...I want to store them in a same column and want to retrieve them from the database(Split method).
Hi Ganaparthi.I need your help regarding the same kind of issue.I have to update rows that are selected by Checking the checkboxes in the GridView.I'm saving the RegistrationID(A Unique Column inth database, by which I'm updating the database) into a string
type variable and I'm updating the row in the for loop given below.The code is working fine but i'm getting performance issue.so,please suggest me how to write an Update Statement that updates the database at one step(By using "ALL" keyword or any other thing).Below
i'm writing my code plz go through it once.
SqlConnection con =
newSqlConnection("Data
Source=localhost;Initial Catalog=hindi;Integrated Security=SSPI"); %
CheckBox cc ;
string s ;
for (byte i = 0; i < GridView1.Rows.Count; i++)
{
cc = (CheckBox)GridView1.Rows[i].FindControl("c1");
if (cc.Checked)
{
s = GridView1.Rows[i].Cells[3].Text;
string strUpdate = " update RegistrationForm set regn_status='Y',RegistrationDate='" + regdate + "' where RegistrationID='" + s +"'" ;
Gopalsridhar...
Member
6 Points
19 Posts
Re: How to store multiple values of CheckBoxList into Database
May 12, 2012 09:54 PM|LINK
Hi
I looked at your suggestion for checkboxlist. I want to do the same in Vb and tried using developer fusion but it most of the times it shows EOF...I want to store them in a same column and want to retrieve them from the database(Split method).
Cheers
Jagan Mohan
Member
29 Points
79 Posts
Re: How to store multiple values of CheckBoxList into Database
Jul 10, 2012 05:47 AM|LINK
Hi Ganaparthi.I need your help regarding the same kind of issue.I have to update rows that are selected by Checking the checkboxes in the GridView.I'm saving the RegistrationID(A Unique Column inth database, by which I'm updating the database) into a string type variable and I'm updating the row in the for loop given below.The code is working fine but i'm getting performance issue.so,please suggest me how to write an Update Statement that updates the database at one step(By using "ALL" keyword or any other thing).Below i'm writing my code plz go through it once.
SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=hindi;Integrated Security=SSPI"); %
CheckBox cc ;
string s ;
for (byte i = 0; i < GridView1.Rows.Count; i++)
{
cc = (CheckBox)GridView1.Rows[i].FindControl("c1");
if (cc.Checked)
{
s = GridView1.Rows[i].Cells[3].Text;
string strUpdate = " update RegistrationForm set regn_status='Y',RegistrationDate='" + regdate + "' where RegistrationID='" + s +"'" ;
SqlCommand cmd2 = new SqlCommand(strUpdate, con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd2);
da.Fill(ds);
}
}