473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Cast problem

Hi,

I wrote a program in ASP.net with IIS 5.1 using VB programming
language. When I transferred a site in a server which uses IIS 6, I had
some mistakes. One mistake is in that instruction:

v_xml = v_xml + "<id>" + CStr(reader1.GetSql32(0)) +"</id>"

This instruction works well in IIS 5.1 but In IIS 6 gives an error of
cast.
I tried a lot of other functions than CStr but I had every time the
same problem.

Thanks for your answers,

Regards,

Djamila.

Oct 22 '06 #1
1 982
"djamila" <dj***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
using VB programming language
I assume you mean VB.NET, not VB...
v_xml = v_xml + "<id>" + CStr(reader1.GetSql32(0)) +"</id>"
Again, I assume you're using SQL Server, and that reader1 is a SqlDataReader
object...

If so, the SqlDataReader object doesn't have a GetSql32 method - it has a
GetSqlInt32 method, though, so I'm further assuming that that's what you
meant, and that the above is a typo...

http://msdn2.microsoft.com/en-us/lib...tsqlint32.aspx
This instruction works well in IIS 5.1 but In IIS 6 gives an error of
cast.
1) What is the complete error message?

2) What is the value of reader1(0) before you try to cast it?

3) Has the underlying database schema changed?

4) Is the IIS6 site pointing at the same database as the IIS 5.1 site...?
Oct 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: A. W. Dunstan | last post by:
I'm porting some code to Visual C++ and have run into a problem - the compiler won't use a user-written cast operator. The code uses an envelope-letter approach to passing (potentially) large...
17
by: Hazz | last post by:
In this sample code of ownerdraw drawmode, why does the '(ComboBox) sender' line of code need to be there in this event handler? Isn't cboFont passed via the managed heap, not the stack, into this...
0
by: Alan Z. Scharf | last post by:
Win Server 2003 VS.Net 2003 --------------- 1. I'm having the same problem below on all six of my pages with a datagrid item. 2. These pages all worked fine for months until problem started....
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
3
by: Mike Cooper | last post by:
Hello All! I am getting teh above error message on the following code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dgt As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.