473,324 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Bind combobox to sql statement result in VB2005

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
11 2512
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
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
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
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
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
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
"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
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
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
'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
'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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Norm | last post by:
Hi, Each time the user selects an item from a combobox, I want that string to get appended to the values that were already selected. The result is that the combo is accumulating text each time...
7
by: Dan | last post by:
Very newbie question here: Any suggestions on how to bind an XML file to a combobox and datagrid? I've had no problem reading the data in a datagrid. But the combobox is another story. I...
6
by: Alpha | last post by:
I have a listbox with datasource from a dataview. When a user selects a different item in a combobox then I need to refresh the listbox to the appropriate listing based on that combobox's selected...
2
by: SKarnis | last post by:
We are trying to rebuild a current Access 2002 (XP) mdb program to VB.NET with a SQL database - we are having problems with a suitable combobox. There are many threads discussing multiple column...
0
by: Webbyz | last post by:
Here is my problem. I have 2 fields fSeason and rSeason in my database. These hold the String values of either Spring or Fall. I have a comboBox in my form that i am trying to bind on load to...
4
by: Steve | last post by:
C# I have some combo boxes, full of lookup descriptions. When I retrieve a dataset for my record, the values that need binding to the combos are the actual record IDs that relate to these...
11
by: Martin | last post by:
Hi all! In VB6.0 A combobox had items, which basically were the description and ItemData which could be used to create a link to a record, that is if the recordset had a numeric key. I was...
1
by: rAinDeEr | last post by:
Hi, I have started using DB2 UDB ESE v8.2 in Linux recently. I have seen a lot of articles on packages, prepare statement, bind and execute statement. I havent got a clear idea. I have...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.