Showing posts with label adataset. Show all posts
Showing posts with label adataset. Show all posts

Thursday, March 22, 2012

Dataset Results

I have created adataset to make a drop down list for a parameter. As shown:

SELECT distinct [Table] FROM [Database]

The results i get back are A, B & C. What i am trying to do is show a result as a different word.

i.e instead of displaying A is shows in drop down list as Apple, B shows Banana. etc.

Can anyone help please.

Thanks

Lookup the usage of case(sql server). This should get you your desired result.|||The parameter can use two columns of the returned dataset, one for the value column and one for the display column, getting this back from the query and binding it to the appropiate properties in the parameter setting should help.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Ok got it working.

select distinct

case [COLUMN NAME]

when 'A' then 'Apple'

when 'B' then 'Banana'

else 'Unknown'end

from [TABLE NAME]

where [COLUMN NAME] in ('A', 'B', 'C')

Wednesday, March 21, 2012

dataset and xml problem

Hello all,
I'm tring to coordinate between a database and a my application throw a
dataset object and a group of dataAdapters, one for each table. to
display data, I use the xml driven from the method DataSet.WriteXml().
to store data I want to receive xml based on the dataset structure and
let the data set store and update everything through the method
DataSet.ReadXML(). this I have difficultes to perform and I cant find
any good examples.
I'd appreciate your help.First, I think you need to reexplain what youre trying to do.
I've read it 3 times, and still don't know exactly.
..
Second...If you're interested in passing dataset xml to a stored
procedure...
go here:
http://www.sqlservercentral.com/col...lem.as
p
Its not ~exactly what you're looking for.. but will give you a place to
start.
Create an xsd/dataset.
It could look something like this:
<ParametersDS>
<Customer>
<CustomerID>CENTC</CustomerID>
</Customer>
<Customer>
<CustomerID>GROSR</CustomerID>
</Customer>
</ParametersDS>
...
If that's not what you're looking for... (after you go thru the URL I
provide), then repost what you're trying to do, and explain it a little
slower and greater detail.
<taleran58@.gmail.com> wrote in message
news:1150107036.031001.242910@.j55g2000cwa.googlegroups.com...
> Hello all,
> I'm tring to coordinate between a database and a my application throw a
> dataset object and a group of dataAdapters, one for each table. to
> display data, I use the xml driven from the method DataSet.WriteXml().
> to store data I want to receive xml based on the dataset structure and
> let the data set store and update everything through the method
> DataSet.ReadXML(). this I have difficultes to perform and I cant find
> any good examples.
> I'd appreciate your help.
>