
October 28th, 2009, 06:19 AM
|
|
Contributing User
|
|
Join Date: Nov 2004
Posts: 153
  
Time spent in forums: 2 Days 17 h 33 m 57 sec
Reputation Power: 7
|
|
|
ASP.Net/VB.Net - Connection string returning empty values
Morning all,
I'm not getting any errors, which is a pleasant surprise, but instead i'm getting no results!
I have a variable, NetTotal, that is supposed to calculate our base cost of the current customer order on the screen, so i can work out estimated profits etc.
For some reason, my code seems to return a null value (i inserted a response.write to show the NetTotal for error checking while i'm developing), unless i specify a zero value when it's declared, in which case it stays that way!
Any thoughts would be appreciated, relevant coding below:
Code:
sConnection = ConfigurationSettings.AppSettings("connString")
objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
objRS = objConn.Execute("SELECT * FROM orders WHERE OrderNo = " & chr(34) & request.querystring("orderno") & chr(34))
While NOT objrs.eof
nsConnection = ConfigurationSettings.AppSettings("connString")
nobjConn = Server.CreateObject("ADODB.Connection")
nobjConn.Open(sConnection)
nobjRS = objConn.Execute("SELECT Supplier1Price,FacetPartNo FROM prices WHERE FacetPartNo = " & objRS.Fields("ProductCode").value)
NetTotal = NetTotal + cdec(nobjRS.Fields("Supplier1Price").value * objRS.Fields("Quantity").value)
***rest of line information here followed by an objRS.movenext and endwhile***
|