.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 15th, 2004, 06:21 PM
timiller timiller is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 timiller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing a Parameter

VB.net Newbie:
I am simply trying to pass a variable from one aspx page to another. The variable - RW is set equal to a pointer in a database. Once I pass the ID from one aspx page to another, I want to use the ID (which is an autonumber database field) to lookup the correct row in the database again, and then I want to fill up textboxes with the corresponding data....txtTitle = title; txtStreet = street, etc.

So here is what is happening:

ASPX code for sending the string and calling the new page:

Dim SID As Integer
SID = DataGrid1.DataKeys(DataGrid1.SelectedIndex)
Response.Redirect("propdetailbe.aspx?RW=" & SID)

ASPX receiving RW:

Me.OleDbConnection1.Open()
Dim RW As Integer
Dim cmd As New OleDbCommand
cmd.Connection = Me.OleDbConnection1()
cmd.CommandText = "SELECT * FROM FeListings2 Where ID=" & RW
Dim Ole As New OleDbDataAdapter
Dim OCB As New OleDb.OleDbCommandBuilder(Ole)
Dim DS As New DataSet
Ole.SelectCommand = cmd
Ole.Fill(DS, "Felistings2")
Dim objRow As DataRow
objRow = DS.Tables("Felistings2").Rows.Item(RW)
txtTitle.Text = objRow.Item("Title")

During troubleshooting, etc. I have observed the following:

objRow=DS.Tables("name of database").Rows.Item(RW)...where RW is a passed integer.

a) With .Item(RW) ....gives an error of input mismatch

b)with .Item("RW").....gives an error of No row at position 0.

c) When I look at debug near the select statement, RW=nothing.

d)When I do Request.Querystring("RW") it yields "X" where X is the correct ID.

e) When I change the select statement to ....where ID=" & 4....it will find the record 4.


So why does RW appear to have a value of "X" but yet pass nothing. Are my naming conventions incorrect?

Any help would be appreciated.


Thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Passing a Parameter


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT