ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Muhammad Abdul Jalil Muhammad Abdul Jalil
تاريخ النشر: 2013/11/24
Bowsil Ameen
من قبل 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

المزيد من الأسئلة المماثلة