Click here to Skip to main content
16,005,038 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: cast control Pin
Christian Graus14-May-09 1:16
protectorChristian Graus14-May-09 1:16 
QuestionWcf vs Webservices Pin
Mogaambo13-May-09 20:56
Mogaambo13-May-09 20:56 
AnswerRe: Wcf vs Webservices Pin
Perry Holman13-May-09 21:14
Perry Holman13-May-09 21:14 
QuestionHow to remove the borders in wizard control Pin
meeram39513-May-09 20:35
meeram39513-May-09 20:35 
Questionwebsite & web appln Pin
dotnetmember13-May-09 20:35
dotnetmember13-May-09 20:35 
AnswerRe: website & web appln Pin
Baran M13-May-09 22:12
Baran M13-May-09 22:12 
GeneralRe: website & web appln Pin
Ramesh Swaminathan13-May-09 22:29
Ramesh Swaminathan13-May-09 22:29 
Questionerror --canot find table(0) Pin
svknair13-May-09 20:06
svknair13-May-09 20:06 
i have 2 tables from where the data is taken
table 1 and table 2
table1 has user, country, city
table2 has country,city

wht i need is

1) selecting user with condition of country and city dropdownlists = the output can be multiple & after exceution of he query
need to get the users


2) selecting fields from table2 from the grid depending on the id( i am getting the selected multiple id from the grid.== uid)

then inserting the user , country , city in table1 with country, city selected fom table 2

if table1 has the combination of user , country , city then update else insert

i have written the code but not getting the desired output
if i use in the below way ie line1 & line2 then i get no error but only the last record in for loop gets affected
and if i use line2 and then line1 i get



sqlstr= "SELECT user FROM table1 " _
& " WHERE country='" & drpcountry.SelectedItem.Text & "' AND city='" & drpcity.SelectedItem.Text & "'"
USERREADER = cmdMain.ExecuteReader()

If USERREADER.HasRows Then
While USERREADER.Read
dim uname= USERREADER("user").ToString.Trim
msgbox(uname)


sqlstr= "select [country],[city] FROM table2 WHERE ID in( " & UID & ") order by country"
'''''''''''''''''''' executing the query using



If ds.Tables(0).Rows.Count > 0 Then
Dim count = ds.Tables(0).Rows.Count


For i = 0 To count - 1

Dim datacountry = ds.Tables(0).Rows(i).Item("country").ToString()
Dim datacity = ds.Tables(0).Rows(i).Item("city").ToString()



sqlstr= "IF EXISTS (SELECT user, country,city FROM table1 " _
& " WHERE user='" & uname & "'" _
& " AND country='" & datacountry & "' AND city='" & datacity & "')" _
& " UPDATE table1 set user='" & uname & "' " _
& " WHERE country='" & datacountry & "' AND city='" & datacity & "' " _
& " Else " _
& " INSERT INTO table1(user,country,city) " _
& " VALUES ('" & uname & "','" & datacountry & "','" & datacity & "')"

Next ''''''' line1

'''''''''''''''''''' executing the query using dataset ''''''''line2

End If


End While
End If
End If


getting error cannnot find table(0)
AnswerRe: error --canot find table(0) Pin
dotnetmember13-May-09 20:37
dotnetmember13-May-09 20:37 
GeneralRe: error --canot find table(0) Pin
svknair13-May-09 21:07
svknair13-May-09 21:07 
GeneralRe: error --canot find table(0) Pin
sriram.101214-May-09 0:58
sriram.101214-May-09 0:58 
QuestionI have problem with accessing local host from diffrent computer?????? Pin
Piyush Vardhan Singh13-May-09 19:53
Piyush Vardhan Singh13-May-09 19:53 
AnswerRe: I have problem with accessing local host from diffrent computer?????? Pin
svknair13-May-09 20:19
svknair13-May-09 20:19 
GeneralRe: I have problem with accessing local host from diffrent computer?????? Pin
Piyush Vardhan Singh13-May-09 20:41
Piyush Vardhan Singh13-May-09 20:41 
GeneralRe: I have problem with accessing local host from diffrent computer?????? Pin
svknair13-May-09 21:04
svknair13-May-09 21:04 
GeneralRe: I have problem with accessing local host from diffrent computer?????? Pin
Piyush Vardhan Singh13-May-09 21:10
Piyush Vardhan Singh13-May-09 21:10 
GeneralRe: I have problem with accessing local host from diffrent computer?????? Pin
Piyush Vardhan Singh13-May-09 21:12
Piyush Vardhan Singh13-May-09 21:12 
AnswerRe: I have problem with accessing local host from diffrent computer?????? Pin
sriram.101214-May-09 1:03
sriram.101214-May-09 1:03 
Questionvb.net BackUp of .mdb file Pin
ballameharmurali13-May-09 19:51
ballameharmurali13-May-09 19:51 
AnswerRe: vb.net BackUp of .mdb file Pin
Baran M13-May-09 22:15
Baran M13-May-09 22:15 
Questionhow can i add a new control in ASP.net page without change view position of that page Pin
AKM_NH13-May-09 19:49
AKM_NH13-May-09 19:49 
AnswerRe: how can i add a new control in ASP.net page without change view position of that page Pin
Ramesh Swaminathan13-May-09 23:20
Ramesh Swaminathan13-May-09 23:20 
Questionradiobuttonlist values fetch from database to gridview Pin
grkrishna13-May-09 19:15
grkrishna13-May-09 19:15 
QuestionPublish on facebook using asp.net Pin
ciqing13-May-09 19:01
ciqing13-May-09 19:01 
QuestionDoubt in regular expression Pin
janani1313-May-09 18:44
janani1313-May-09 18:44 

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.