Click here to Skip to main content
15,897,273 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionproblem running vb6 application in client side Pin
RohitRajPokhrel8-May-07 16:08
RohitRajPokhrel8-May-07 16:08 
Questiondatagrid refresh using updated dataset Pin
brendagv8-May-07 15:55
brendagv8-May-07 15:55 
QuestionSelect DataGrid Row Pin
New_Coder8-May-07 12:19
New_Coder8-May-07 12:19 
AnswerRe: Select DataGrid Row Pin
P P Vilsad8-May-07 16:02
P P Vilsad8-May-07 16:02 
GeneralRe: Select DataGrid Row Pin
New_Coder9-May-07 6:21
New_Coder9-May-07 6:21 
Questionlearn vb.net to connect to plc Pin
superappman8-May-07 11:46
superappman8-May-07 11:46 
QuestionUser Controls Pin
Ridge Howison8-May-07 11:33
Ridge Howison8-May-07 11:33 
QuestionCurrentrow syntax issue Pin
Hansduncan8-May-07 10:23
Hansduncan8-May-07 10:23 
I am trying to run an insert for each row on a datagridview that is selected (checkbox on 0 column index). My problem is that the @articleID parameter is not selected from the correct row. I want the to pick up the articleID from the row that is being iterated through. Looks like the currentrow syntax isn't working. Any suggestions?

<br />
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        Dim myCmd As New SqlCommand("sp_Create_NewPriceListLine", MDIParent1.Conn)<br />
        myCmd.CommandType = CommandType.StoredProcedure<br />
<br />
        For Each Row As DataGridViewRow In Article_searchDataGridView.Rows<br />
            Dim include As DataGridViewCheckBoxCell = TryCast(Row.Cells("Select_Article"), DataGridViewCheckBoxCell)<br />
<br />
            If Row.Cells("Select_Article").Value = True Then<br />
                MDIParent1.Conn.Open()<br />
                Dim discountID As SqlParameter = myCmd.Parameters.AddWithValue("@discountID", Me.DiscountIdTextBox1.Text)<br />
                discountID.Direction = ParameterDirection.Input<br />
               <br />
                Dim articleID As SqlParameter = myCmd.Parameters.AddWithValue("@articleID", Me.Article_searchDataGridView.Item(7, Me.Article_searchDataGridView.CurrentRow.Index).Value) 'Me.Article_searchDataGridView.CurrentRow.Index).Value)<br />
                articleID.Direction = ParameterDirection.Input<br />
<br />
                Dim userID As SqlParameter = myCmd.Parameters.AddWithValue("@userID", MDIParent1.userid)<br />
                userID.Direction = ParameterDirection.Input<br />
<br />
                Dim myReader As SqlDataReader = myCmd.ExecuteReader()<br />
<br />
                myReader.Close()<br />
                MDIParent1.Conn.Close()<br />
            End If<br />
            myCmd.Parameters.Clear()<br />
<br />
        Next<br />
End Sub<br />

AnswerRe: Currentrow syntax issue Pin
Hansduncan8-May-07 11:27
Hansduncan8-May-07 11:27 
QuestionClicking DropDownList item should do.. Pin
porsti8-May-07 10:12
porsti8-May-07 10:12 
AnswerRe: Clicking DropDownList item should do.. Pin
MatrixCoder8-May-07 10:18
MatrixCoder8-May-07 10:18 
AnswerRe: Clicking DropDownList item should do.. Pin
Sherin Iranimose8-May-07 18:54
Sherin Iranimose8-May-07 18:54 
GeneralRe: Clicking DropDownList item should do.. Pin
porsti9-May-07 19:41
porsti9-May-07 19:41 
GeneralActive Directory question Pin
Psycho-*Coder*-Extreme8-May-07 9:19
Psycho-*Coder*-Extreme8-May-07 9:19 
GeneralRe: Active Directory question Pin
Dave Kreskowiak8-May-07 10:10
mveDave Kreskowiak8-May-07 10:10 
GeneralRe: Active Directory question Pin
Psycho-*Coder*-Extreme8-May-07 10:28
Psycho-*Coder*-Extreme8-May-07 10:28 
GeneralRe: Active Directory question Pin
Dave Kreskowiak8-May-07 10:36
mveDave Kreskowiak8-May-07 10:36 
GeneralRe: Active Directory question Pin
Psycho-*Coder*-Extreme8-May-07 11:07
Psycho-*Coder*-Extreme8-May-07 11:07 
QuestionHow to make a program that is able to save data ? Pin
Me0w!8-May-07 8:13
Me0w!8-May-07 8:13 
AnswerRe: How to make a program that is able to save data ? Pin
Dave Kreskowiak8-May-07 8:16
mveDave Kreskowiak8-May-07 8:16 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 8:58
Me0w!8-May-07 8:58 
GeneralRe: How to make a program that is able to save data ? Pin
Dave Kreskowiak8-May-07 10:05
mveDave Kreskowiak8-May-07 10:05 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 10:21
Me0w!8-May-07 10:21 
QuestionDeleting multiple rows Pin
TAK788-May-07 8:00
TAK788-May-07 8:00 
AnswerRe: Deleting multiple rows Pin
Dave Kreskowiak8-May-07 8:13
mveDave Kreskowiak8-May-07 8:13 

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.