473,804 Members | 3,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Type Conversion in Win2k and XP

i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList

Dim x As Integer

'Filling Servers Name

sqlNameList = sqlApp.ListAvai lableSQLServers

For x = 1 To sqlNameList.Cou nt
cbo_Server.Item s.Add(UCase(sql NameList.Item(x )))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error becuase the combo box expects a string or ordinal, so to get round this i had to do a type conversion. but i was just wondering why i needed to do this on Win2k and not XP?

For x = 1 To sqlNameList.Cou nt

str_Server = CType(sqlNameLi st.Item(x), String)
cbo_Server.Item s.Add(UCase(str _Server))

Next

Cheers,
Craig

Nov 21 '05 #1
2 887
Hi,

My guess is that option strict in turned on in the win 2000 machine.
Please post your messages in the future in text not everyone can read the
messages when they are in richtext format.

http://msdn.microsoft.com/library/de...tionStrict.asp
Ken
-----------------------
"Craig G" <cr**********@y arrasoftware.co m> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList
Dim x As Integer
'Filling Servers Name
sqlNameList = sqlApp.ListAvai lableSQLServers
For x = 1 To sqlNameList.Cou nt
cbo_Server.Item s.Add(UCase(sql NameList.Item(x )))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error
becuase the combo box expects a string or ordinal, so to get round this i
had to do a type conversion. but i was just wondering why i needed to do
this on Win2k and not XP?
For x = 1 To sqlNameList.Cou nt
str_Server = CType(sqlNameLi st.Item(x), String)
cbo_Server.Item s.Add(UCase(str _Server))
Next

Cheers,
Craig
Nov 21 '05 #2
no cant be that either, option strict on the project itself is turned off.

the Win2k & XP machines that im running it on are test pc's, so only have
the OS & .NET 1.1 framework on them

sorry bout the richtext!

Craig
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:eZ******** *****@TK2MSFTNG P09.phx.gbl...
Hi,

My guess is that option strict in turned on in the win 2000 machine. Please post your messages in the future in text not everyone can read the
messages when they are in richtext format.

http://msdn.microsoft.com/library/de...tionStrict.asp

Ken
-----------------------
"Craig G" <cr**********@y arrasoftware.co m> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
i have the following snippet of code for getting a list of SQL Servers

Dim sqlNameList As SQLDMO.NameList
Dim x As Integer
'Filling Servers Name
sqlNameList = sqlApp.ListAvai lableSQLServers
For x = 1 To sqlNameList.Cou nt
cbo_Server.Item s.Add(UCase(sql NameList.Item(x )))
Next

this all runs fine on XP but when you try and run it on Win2k i get an error becuase the combo box expects a string or ordinal, so to get round this i
had to do a type conversion. but i was just wondering why i needed to do
this on Win2k and not XP?
For x = 1 To sqlNameList.Cou nt
str_Server = CType(sqlNameLi st.Item(x), String)
cbo_Server.Item s.Add(UCase(str _Server))
Next

Cheers,
Craig

Nov 21 '05 #3

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

Similar topics

2
3078
by: bbxrider | last post by:
win2k adv server/ iis5.0/vb6.0/ado and/or odbc connections on client machine i have an mdb on win2k adv server machine and want internet read/write to it from both a non-windows, red hat, webserver using asp/vbscript and a win xp/2000 machine with vb6.0/ado with or without odbc set up how do you set up the win2k server machine and/or mdb??? i know enough that some application/service needs to be listening on some port so far i have the...
26
3833
by: David W. Fenton | last post by:
A client is panicking about their large Access application, which has been running smoothly with 100s of thousands of records for quite some time. They have a big project in the next year that will lead to a lot of use of the database and the adding of quite a lot of new data (though I can't conceive of them adding more than than 10s of thousands of records, which won't change the current performance profile at all). If there is a SQL...
7
2243
by: Madhu Gopinathan | last post by:
Hi, I hope this is the right forum for this question. I am extending ICollection to create a Collection Type (say MyCollection) wherein I can control the types of objects being added to the collection. Thus, my interface now looks like this public interface IMyCollection : ICollection { void Add (string toBeAdded);
16
12802
by: Enekajmer | last post by:
Hi, 1 int main() 2 { 3 float a = 17.5; 4 printf("%d\n", a); 5 printf("%d\n", *(int *)&a); 6 return 0; 7 }
2
1887
by: Martin v. Lwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version: $Revision: 42333 $
1
3286
by: lovecreatesbeauty | last post by:
There is a warning/(error? I remember it is an error for line 10 on some compilers before. At least on g++, it is an error.) for line 10. I first read a similar example from `Expert C Programming -- Deep Secrets, Perter van der Linden'. But I wonder why line 9 is ok but line 10 is illegal? Is what Keith Thompson said in another post also helpful to understand this question: "... The implicit conversion rule applies only to void*, not...
669
26256
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
4
2113
by: zaeminkr | last post by:
I got a good answer here I have still confusing part. I have two very simple classes class DRect { private : double x0, y0, x1, y1; public : DRect(double a, double b, double c, double d) : x0(a), y0(b),
8
3153
by: Smithers | last post by:
Are there any important differences between the following two ways to convert to a type?... where 'important differences' means something more profound than a simple syntax preference of the developer. x = someObject as MySpecificType; x = (MySpecificType) someObject; Thanks.
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9572
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10070
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.