By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,899 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,899 IT Pros & Developers. It's quick & easy.

Bind combobox to sql statement result in VB2005

P: n/a
guy
I am able to use the Server Explorer to create a dataset containing tables in my database. I am able
to bind a table to my combobox and set a filter by including a where clause. But I am unable to
concat 2 columns as an addition column in the select statement without getting an error. It seems
that I am restricted to use only the columns of the table.

How do I bind a combobox to the resultset of a SQL statement?

Furthermore, I need to sync the contents of a datagrid from the selectedvalue of the combobox. Any
ideas?
Mar 9 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Post your code (like your query at least), and we may be able to help you.

Robin S.

"guy" <gu*@hotmail.comwrote in message
news:c8********************************@4ax.com...
>I am able to use the Server Explorer to create a dataset containing tables
in my database. I am able
to bind a table to my combobox and set a filter by including a where
clause. But I am unable to
concat 2 columns as an addition column in the select statement without
getting an error. It seems
that I am restricted to use only the columns of the table.

How do I bind a combobox to the resultset of a SQL statement?

Furthermore, I need to sync the contents of a datagrid from the
selectedvalue of the combobox. Any
ideas?

Mar 9 '07 #2

P: n/a
guy
On Thu, 8 Mar 2007 22:11:52 -0800, "RobinS" <Ro****@NoSpam.yah.nonewrote:
>Post your code (like your query at least), and we may be able to help you.

Robin S.
The problem has to do with visual programming so the only code is SQL. I tracked down to the Query
Builder in TableAdapter Config. It seems that the sql parser only recognizes the plus sign (+) as a
string concatenation operator but this is not portable to other RDBMS that use the ANSI SQL standard
vertical bars "||" string concatenation operator.

The following ANSI SQL is not accepted by the TableAdapter Query Builder parser although the
statement executes properly:

select sColumn1 || sColumn2 as expr1 from mytable;

The following SQL works in SQL Server but it is not portable to other RDBMS:
select sColumn1 + sColumn2 as expr1 from mytable;

Mar 10 '07 #3

P: n/a
huh?

Im really not sure i've seen that before.. is that mySql?

I mean do you really think that is ANSI?

-Aaron


On Mar 9, 5:58 pm, guy <g...@hotmail.comwrote:
On Thu, 8 Mar 2007 22:11:52 -0800, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Post your code (like your query at least), and we may be able to help you.
Robin S.

The problem has to do with visual programming so the only code is SQL. I tracked down to the Query
Builder in TableAdapter Config. It seems that the sql parser only recognizes the plus sign (+) as a
string concatenation operator but this is not portable to other RDBMS that use the ANSI SQL standard
vertical bars "||" string concatenation operator.

The following ANSI SQL is not accepted by the TableAdapter Query Builder parser although the
statement executes properly:

select sColumn1 || sColumn2 as expr1 from mytable;

The following SQL works in SQL Server but it is not portable to other RDBMS:
select sColumn1 + sColumn2 as expr1 from mytable;

Mar 10 '07 #4

P: n/a
and for the record; you can always make a 'calculated column' in SQL
Server

so you could call this sColumns and set the formula for this to
sColumn1 + sColumn2
and then you could bind the crap to the single column

I love calculated columns; I don't think that very many other vendors
support this; but I use them ALL the friggin time



On Mar 9, 5:58 pm, guy <g...@hotmail.comwrote:
On Thu, 8 Mar 2007 22:11:52 -0800, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Post your code (like your query at least), and we may be able to help you.
Robin S.

The problem has to do with visual programming so the only code is SQL. I tracked down to the Query
Builder in TableAdapter Config. It seems that the sql parser only recognizes the plus sign (+) as a
string concatenation operator but this is not portable to other RDBMS that use the ANSI SQL standard
vertical bars "||" string concatenation operator.

The following ANSI SQL is not accepted by the TableAdapter Query Builder parser although the
statement executes properly:

select sColumn1 || sColumn2 as expr1 from mytable;

The following SQL works in SQL Server but it is not portable to other RDBMS:
select sColumn1 + sColumn2 as expr1 from mytable;

Mar 10 '07 #5

P: n/a
Okay, now I know what you're talking about. I feel your pain. I used Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to do
different syntax?

Robin S.
--------------------------
"guy" <gu*@hotmail.comwrote in message
news:er********************************@4ax.com...
On Thu, 8 Mar 2007 22:11:52 -0800, "RobinS" <Ro****@NoSpam.yah.none>
wrote:
>>Post your code (like your query at least), and we may be able to help
you.

Robin S.
The problem has to do with visual programming so the only code is SQL. I
tracked down to the Query
Builder in TableAdapter Config. It seems that the sql parser only
recognizes the plus sign (+) as a
string concatenation operator but this is not portable to other RDBMS
that use the ANSI SQL standard
vertical bars "||" string concatenation operator.

The following ANSI SQL is not accepted by the TableAdapter Query Builder
parser although the
statement executes properly:

select sColumn1 || sColumn2 as expr1 from mytable;

The following SQL works in SQL Server but it is not portable to other
RDBMS:
select sColumn1 + sColumn2 as expr1 from mytable;

Mar 10 '07 #6

P: n/a
guy
On Sat, 10 Mar 2007 10:14:33 -0800, "RobinS" <Ro****@NoSpam.yah.nonewrote:
>Okay, now I know what you're talking about. I feel your pain. I used Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to do
different syntax?

Robin S.
I need to stick with portable code so using the plus sign (+) for concatenation in SQL is not an
option. What is the work around in VB2005?
Mar 10 '07 #7

P: n/a
"guy" <gu*@hotmail.comwrote in message
news:in********************************@4ax.com...
On Sat, 10 Mar 2007 10:14:33 -0800, "RobinS" <Ro****@NoSpam.yah.none>
wrote:
>>Okay, now I know what you're talking about. I feel your pain. I used
Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to
do
different syntax?

Robin S.

I need to stick with portable code so using the plus sign (+) for
concatenation in SQL is not an
option. What is the work around in VB2005?
It looks like you're SOL. From what I can find, that is the only
concatenation symbol in SQLServer. You could try posting your question to
microsoft.public.sqlserver.programming and see if they have any other
ideas.

Robin S.
Mar 11 '07 #8

P: n/a
maybe you could write a function and call it ||

Select FirstName + dbo.|| + LastName

ROFLMAO
On Mar 11, 10:55 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
"guy" <g...@hotmail.comwrote in message

news:in********************************@4ax.com...


On Sat, 10 Mar 2007 10:14:33 -0800, "RobinS" <Rob...@NoSpam.yah.none>
wrote:
>Okay, now I know what you're talking about. I feel your pain. I used
Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to
do
different syntax?
>Robin S.
I need to stick with portable code so using the plus sign (+) for
concatenation in SQL is not an
option. What is the work around in VB2005?

It looks like you're SOL. From what I can find, that is the only
concatenation symbol in SQLServer. You could try posting your question to
microsoft.public.sqlserver.programming and see if they have any other
ideas.

Robin S.- Hide quoted text -

- Show quoted text -

Mar 13 '07 #9

P: n/a
you need to stick with 'portable code'
THEN DONT USE ORACLE PROPIETARY _CRAP_ DOG


On Mar 10, 12:49 pm, guy <g...@hotmail.comwrote:
On Sat, 10 Mar 2007 10:14:33 -0800, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Okay, now I know what you're talking about. I feel your pain. I used Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to do
different syntax?
Robin S.

I need to stick with portable code so using the plus sign (+) for concatenation in SQL is not an
option. What is the work around in VB2005?

Mar 13 '07 #10

P: n/a
'I need to use portbale code' so can you please make SQL Server work
like this Oracle _CRAP_

Oracle is obsolete dog.. check out www.olapreport.com

if you're not usign Olap you're shit outta luck and you're roadkill

OLAP solves every database performance problem in the world

On Mar 10, 12:49 pm, guy <g...@hotmail.comwrote:
On Sat, 10 Mar 2007 10:14:33 -0800, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Okay, now I know what you're talking about. I feel your pain. I used Oracle
in my last app, which uses the ||. But why do you need to use that if you
are using SQLServer in the background? Or does the strongly typed dataset
stuff not recognize when the database is non-SQLServer and allow you to do
different syntax?
Robin S.

I need to stick with portable code so using the plus sign (+) for concatenation in SQL is not an
option. What is the work around in VB2005?

Mar 13 '07 #11

P: n/a
'this is not portable to other RDBMS'

please give examples.. are you only referring to Oracle?

Oracle hasn't been competitive for 5 years www.olapreport.com/market.htm

Oracle has less than 5% marketshare dog; don't bitch about making SQL
act like Oracle dude.. Oracle is for fucking retards that are stuck in
the 90s

On Mar 9, 6:58 pm, guy <g...@hotmail.comwrote:
On Thu, 8 Mar 2007 22:11:52 -0800, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Post your code (like your query at least), and we may be able to help you.
Robin S.

The problem has to do with visual programming so the only code is SQL. I tracked down to the Query
Builder in TableAdapter Config. It seems that the sql parser only recognizes the plus sign (+) as a
string concatenation operator but this is not portable to other RDBMS that use the ANSI SQL standard
vertical bars "||" string concatenation operator.

The following ANSI SQL is not accepted by the TableAdapter Query Builder parser although the
statement executes properly:

select sColumn1 || sColumn2 as expr1 from mytable;

The following SQL works in SQL Server but it is not portable to other RDBMS:
select sColumn1 + sColumn2 as expr1 from mytable;

Mar 13 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.