473,467 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
Create 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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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 1600
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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**************@TK2MSFTNGP12.phx.gbl...
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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**************@TK2MSFTNGP12.phx.gbl...
buc
have you tried select field1 & ' - ' & field2
Doug
"buc" <bu******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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******@hotmail.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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******@hotmail.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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 misunderstanding, 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**************@TK2MSFTNGP11.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******@hotmail.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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(dReader(0).Value.Replace(" ", "&nbsp;"),
dReader(1).Value)
Loop

Greg
"buc" <bu******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP12.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.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()

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
by: basecamp | last post by:
just checking the average age of programmers using this group -- thanks
4
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
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...
8
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?...
0
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 =...
20
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...
9
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...
3
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.