473,548 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Whats the deal?

buc
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims the
spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine I
try it on, (diff developemnt computers too). Whats going on? I have no TRIM
statments, NO FORMAT statements in the combobox properties. It is directly
bound!! Thanks!!
BUC

Nov 21 '05 #1
8 1619
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotma il.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine I try it on, (diff developemnt computers too). Whats going on? I have no TRIM statments, NO FORMAT statements in the combobox properties. It is directly
bound!! Thanks!!
BUC

Nov 21 '05 #2
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotma il.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine I try it on, (diff developemnt computers too). Whats going on? I have no TRIM statments, NO FORMAT statements in the combobox properties. It is directly
bound!! Thanks!!
BUC

Nov 21 '05 #3
buc
No effect... A BUG maybe??

"Doug Bell" <dug@bigpond> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotma il.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I
build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims

the
spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine

I
try it on, (diff developemnt computers too). Whats going on? I have no

TRIM
statments, NO FORMAT statements in the combobox properties. It is
directly
bound!! Thanks!!
BUC


Nov 21 '05 #4
buc
No effect... A BUG maybe??

"Doug Bell" <dug@bigpond> wrote in message
news:O0******** ******@TK2MSFTN GP12.phx.gbl...
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotma il.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I
build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims

the
spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine

I
try it on, (diff developemnt computers too). Whats going on? I have no

TRIM
statments, NO FORMAT statements in the combobox properties. It is
directly
bound!! Thanks!!
BUC


Nov 21 '05 #5
Buc,

A combobox does not have a DataTextField, that is a property from a
dropdownlist.

Windowforms controls cannot be loaded directly from a datareader as webform
controls can.

Your code looks completly as webform code by the way however there does the
combobox not exist.

So it is strange it works "great"

And please don't call something a bug before you know it is, because you
could have said as well, "is the problem that it is raining here". The only
thing it is telling it "I have to less knowledge to solve this problem".
However say that than and don't accusse others who made those controls.

Just my thoughts.

Cor

"buc" <bu******@hotma il.com>

....
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims
the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine
I try it on, (diff developemnt computers too). Whats going on? I have no
TRIM statments, NO FORMAT statements in the combobox properties. It is
directly bound!! Thanks!!
BUC

Nov 21 '05 #6
Buc,

A combobox does not have a DataTextField, that is a property from a
dropdownlist.

Windowforms controls cannot be loaded directly from a datareader as webform
controls can.

Your code looks completly as webform code by the way however there does the
combobox not exist.

So it is strange it works "great"

And please don't call something a bug before you know it is, because you
could have said as well, "is the problem that it is raining here". The only
thing it is telling it "I have to less knowledge to solve this problem".
However say that than and don't accusse others who made those controls.

Just my thoughts.

Cor

"buc" <bu******@hotma il.com>

....
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims
the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine
I try it on, (diff developemnt computers too). Whats going on? I have no
TRIM statments, NO FORMAT statements in the combobox properties. It is
directly bound!! Thanks!!
BUC

Nov 21 '05 #7
Buc
Cor,

Maybe a misunderstandin g, my apologies..it is in a webform, with a
'dropdownlist', not a 'combo' type box. However, I have contacted Microsoft
and this is a reproducible issue using the dropdownlist in a webform. Maybe
a fix sometimes in the future. O Well...
Buc

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:OH******** ******@TK2MSFTN GP11.phx.gbl...
Buc,

A combobox does not have a DataTextField, that is a property from a
dropdownlist.

Windowforms controls cannot be loaded directly from a datareader as webform controls can.

Your code looks completly as webform code by the way however there does the combobox not exist.

So it is strange it works "great"

And please don't call something a bug before you know it is, because you
could have said as well, "is the problem that it is raining here". The only thing it is telling it "I have to less knowledge to solve this problem".
However say that than and don't accusse others who made those controls.

Just my thoughts.

Cor

"buc" <bu******@hotma il.com>

...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the strings). HOWEVER, when VB places this string in the combo box, It trims
the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine I try it on, (diff developemnt computers too). Whats going on? I have no
TRIM statments, NO FORMAT statements in the combobox properties. It is
directly bound!! Thanks!!
BUC


Nov 21 '05 #8
Browser will toss extra spaces in HTML. I am pretty sure that is what you
are seeing.

You may have to replace your spaces with &nbsp; codes. But don't quote me
on that! (That will be tricky to do without using a loop and manually
adding items to the dropdown box.

untested:

Do while dReader.Read
combobox1.Items .Add(New ListItem(dReade r(0).Value.Repl ace(" ", "&nbsp;"),
dReader(1).Valu e)
Loop

Greg
"buc" <bu******@hotma il.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.phx.gbl...
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is

'load stored proc then

dReader = tmpSQL.SQLcmd.E xecuteReader()
combobox1.DataS ource = dReader
dReader.Read()
combobox1.DataT extField = dReader.GetName (0)
combobox1.DataB ind()

This works great EXCEPT VB is removing the spaces from the string. I build
the string with a SQL statement
select field1 + ' - ' + field2 from table
This returns XXX - YYYY for example (verified by just reading the
strings). HOWEVER, when VB places this string in the combo box, It trims
the spaces between the XXX and YYYY and leaves the string
XXX-YYYY. It always does this. This is crazy. It does it on every machine
I try it on, (diff developemnt computers too). Whats going on? I have no
TRIM statments, NO FORMAT statements in the combobox properties. It is
directly bound!! Thanks!!
BUC

Nov 21 '05 #9

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

Similar topics

176
8128
by: basecamp | last post by:
just checking the average age of programmers using this group -- thanks
4
2240
by: Alfonzo Morra | last post by:
I've the ff code in cp assignmenent cstor: PB& PB::operator=( const PB& b) { if ( this != &b ) { PB *pb = new PB( b ) ; this = pb ; // <- Compiler barfs here } return *this ; }
4
1430
by: Ron Vecchi | last post by:
I recently picked up a Managed Direct 3d book and the examples are in c++. I've always used C# and wonder if c++ is more suited to Direct 3D programming. Of course I know they both access the same framework so I'm thinking their is no difference. But, it seems all examples either on the net or in books are always in c++, Is this because of...
8
2721
by: Z D | last post by:
Hi, I was wondering what's the point of "finally" is in a try..catch..finally block? Isn't it the same to put the code that would be in the "finally" section right after the try/catch block? (ie, forget the finally block and just end the try/catch and put the code after the try/catch block). Or does the "finally" construct add some...
0
262
by: buc | last post by:
I have a simple combox on the screen that is bound via a datareader to a stored proc in sql that returns a simple string. The code is 'load stored proc then dReader = tmpSQL.SQLcmd.ExecuteReader() combobox1.DataSource = dReader dReader.Read() combobox1.DataTextField = dReader.GetName(0) combobox1.DataBind()
20
2424
by: Snis Pilbor | last post by:
Whats the point of making functions which take arguments of a form like "const char *x"? It appears that this has no effect on the function actually working and doing its job, ie, if the function doesn't write to x, then it doesnt seem like the compiler could care less whether I specify the const part. Quite the opposite, if one uses const...
9
1540
by: Christopera | last post by:
I setup a site that uses a set width main body then installed some divs within the body. In Opera, IE7, and FF it all looks pretty similar, some small problems with IE7 but the site still looks good. In IE6 one of my right floated divs sort of slides to the right a bit further than in the rest of the browsers leaving a nice 5 px gap between the...
3
390
by: Thomas 'PointedEars' Lahn | last post by:
Erwin Moller wrote: Just to add a bit more off-topic noise: The World Wide Web is not really a part of the Internet (interconnected networks); it is *an application of* the Internet. The Internet is the hardware, the Web is one kind of software for it; e-mail, for example, is another. Usenet (orig.: Unix User Network) is not a part of...
0
7438
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...
0
7707
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. ...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
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...
0
6036
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3495
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...
1
1926
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
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.