Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to insert multi-values in SQL through checkbox using c#?

user-image
Question ajoutée par Muhammad Abdul Jalil Muhammad Abdul Jalil
Date de publication: 2013/11/24
Bowsil Ameen
par Bowsil Ameen , Sharepoint Development officer / architect , Etihad Airways

Dear Muhammad,

 

To rephrase the question you have asked.( correct me if i am wrong)

 

have muliple values in gridview( has text box and checkbox) you have to insert all the rows which are selected

 

here is the small code sample

just place button and on the event

 

foreach(GridViewRow rw in gv_discpoint.Rows)

{CheckBox chkfill =(CheckBox)rw.FindControl("txtchk");

TextBox txtaction =(TextBox)rw.FindControl("txtAction");

TextBox txttarget =(TextBox)rw.FindControl("txttarget");

if(chkfill.Checked==true)

{

 InsertintoSQL( txtaction.Text,txttarget.Text) /// Method to insert value to sql use

}

elseif(chkfill.Checked==false)

{

// do something

}

}

 

Cheers

Ameen.S

More Questions Like This