|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Only first row from datareader gets affected
only first row from datareader gets affected
sqlstr = "select country , city FROM tbl_data WHERE RID in( " & ID & ") " dr = ''''''''''''''''''''exexuting the reader Ifdr.HasRows Then Whiledr.Read Dim datacountry =dr("country").ToString.Trim Dim datacity =dr("city").ToString.Trim MsgBox(datacountry & "===" & datacity) sqlstr = "SELECT user FROM tbl_info " _ & " WHERE country='" & drpcountry.SelectedItem.Text & "' AND city='" & drp city.SelectedItem.Text & "'" dr = ''''''''''''''''''''exexuting the reader Ifdr.HasRows Then Whiledr.Read sqlstr = "IF EXISTS (SELECT user, country, city FROM tbl_info " _ & " WHERE user='" &dr("user").ToString.Trim & "'" _ & " AND country='" & datacountry & "' AND city='" & datacity & "')" _ & " UPDATE tbl_info set user='" &dr("user").ToString.Trim & "' " _ & " WHERE user='" &dr("user").ToString.Trim & "' AND country='" & datacountry & "' AND city='" & datacity & "' " _ & " Else " _ & " INSERT INTO tbl_info(user,country, city) " _ & " VALUES ('" &dr("user").ToString.Trim & "','" & datacountry & "','" & datacity & "')" ''''''''''exexuting the query........ End While End If End While End If but in this only the first record from the country and city gets affected. all the records obtained in the reader shld get affected how do i rectify it |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Only first row from datareader gets affected |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|