Click here to Skip to main content
15,914,415 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPrinting a report Pin
dptalt5-Dec-06 8:48
dptalt5-Dec-06 8:48 
Questiondataset setup Pin
gorenekli5-Dec-06 6:03
gorenekli5-Dec-06 6:03 
AnswerRe: dataset setup Pin
Kenshino5-Dec-06 9:58
Kenshino5-Dec-06 9:58 
AnswerRe: dataset setup Pin
Polymorpher5-Dec-06 11:06
Polymorpher5-Dec-06 11:06 
Generalworking with large textfiles over the network Pin
milkyjoe5-Dec-06 5:56
milkyjoe5-Dec-06 5:56 
QuestionRe: working with large textfiles over the network Pin
Are Jay5-Dec-06 18:03
Are Jay5-Dec-06 18:03 
AnswerRe: working with large textfiles over the network Pin
milkyjoe5-Dec-06 23:06
milkyjoe5-Dec-06 23:06 
QuestionHelp me with weird datagrid checkbox problem Pin
Kenshino5-Dec-06 3:21
Kenshino5-Dec-06 3:21 
I'm not sure if this is the correct area, forgive me if it is not!

I have this datagrid that is called deleteCourseGrid and it has a template column. I put a checkbox inside and its ID is deleteCheck.

I also have a confirm button that runs the code below.

The problem is, somehow, it does not detect that a box is checked. I tried checking each individual rows and cb.checked is always false.

Am I doing something wrong?

Thanks for help in advance!

Dim connection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))<br />
Dim command As New SqlCommand("delete from course where courseID = @courseID", connection)<br />
Dim i As Integer = 0<br />
Dim cb As CheckBox<br />
Dim courseID As String<br />
cb = deleteCourseGrid.Items(i).FindControl("deleteCheck")<br />
For i = 0 To deleteCourseGrid.Items.Count - 1<br />
    If cb.Checked = True Then<br />
        courseID = deleteCourseGrid.Items(i).Cells(0).Text<br />
        command.Parameters.Add("@courseID", courseID)<br />
        connection.Open()<br />
        command.ExecuteNonQuery()<br />
        connection.Close()<br />
    End If<br />
Next<br />
Response.Redirect("updated.aspx")

AnswerRe: Help me with weird datagrid checkbox problem Pin
Kevin Nicol5-Dec-06 3:53
Kevin Nicol5-Dec-06 3:53 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kenshino5-Dec-06 4:28
Kenshino5-Dec-06 4:28 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kevin Nicol5-Dec-06 5:18
Kevin Nicol5-Dec-06 5:18 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kenshino5-Dec-06 5:29
Kenshino5-Dec-06 5:29 
AnswerRe: Help me with weird datagrid checkbox problem Pin
Kevin Nicol5-Dec-06 6:17
Kevin Nicol5-Dec-06 6:17 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kenshino5-Dec-06 10:08
Kenshino5-Dec-06 10:08 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kapil Thakur6-Dec-06 1:06
Kapil Thakur6-Dec-06 1:06 
AnswerRe: Help me with weird datagrid checkbox problem Pin
Kapil Thakur5-Dec-06 20:53
Kapil Thakur5-Dec-06 20:53 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kenshino5-Dec-06 23:57
Kenshino5-Dec-06 23:57 
GeneralRe: Help me with weird datagrid checkbox problem Pin
Kapil Thakur6-Dec-06 1:01
Kapil Thakur6-Dec-06 1:01 
QuestionHelp me tune up this class, pls Pin
king gamo5-Dec-06 3:05
king gamo5-Dec-06 3:05 
AnswerRe: Help me tune up this class, pls Pin
Guffa5-Dec-06 5:15
Guffa5-Dec-06 5:15 
Questionclick in datagrid's cell Pin
Smithers-Jones5-Dec-06 2:17
Smithers-Jones5-Dec-06 2:17 
AnswerRe: click in datagrid's cell Pin
Kevin Nicol5-Dec-06 3:01
Kevin Nicol5-Dec-06 3:01 
GeneralRe: click in datagrid's cell Pin
Smithers-Jones5-Dec-06 5:30
Smithers-Jones5-Dec-06 5:30 
QuestionNEED HELP NOW Pin
luna_harp5-Dec-06 2:10
luna_harp5-Dec-06 2:10 
AnswerRe: NEED HELP NOW [modified] Pin
ludoder5-Dec-06 2:59
ludoder5-Dec-06 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.