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 8 1592
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
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
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
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
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
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
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
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 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(" ", " "),
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: basecamp |
last post by:
just checking the average age of programmers using this group
--
thanks
|
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 ;
}
|
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...
|
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?...
|
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 =...
|
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...
|
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...
|
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...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
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...
|
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...
| |