|
-
May 13th, 2003, 10:16 AM
#1
Thread Starter
Member
fill a dataset help
I created the oleDB adapter and the connections using the wizzird in VS.Net pro. Now in the adapter we can genarate a dataset for the sql qurey. which most of the time is select user.* form User etc.
now the problem comes when i wanted to show the dataset in a datagrid i notice that some of the field i don't need(another word i need to refine the data in the dataset). Is there a way to create the dataset my self using my own OleDBCommand and fill it to a new dataset and then use that in my datagrid?
I'm kind of used to the wizzard so is it possible that you show me some coding Plz^^
-
May 13th, 2003, 11:48 AM
#2
Frenzied Member
Y dont you just choose the desired fields when adding the oledbdadaadapter? Run the query builder and just add fileds you need.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 13th, 2003, 12:16 PM
#3
Sleep mode
Something like this should works fine :
dim SQLStr as string ="SELECT column1,column2 FROM table1"
dim ds as new dataset()
dim adp as new oledbadapter(SQLStr , myconnectionObj)
adp.fill(ds,tablename)
I don't have VB.NET here so I can't be sure if syntax is %100 correct but follow same steps .
-
May 13th, 2003, 09:27 PM
#4
Thread Starter
Member
^^ i know i can do that
but the ony problem is that i've already done the update part already and i don't want to change any code in the update so that i can store some column to a new dataset
i think it easy if i go to a new dataset since the update already uses the one created by the adepter
-
May 13th, 2003, 10:26 PM
#5
Thread Starter
Member
after i get my dataset how can i refine it to another dataset
for example: if i have the following coloum in my exiting dataset
if i wanted a new dataset with count coloumn for a single user how do i do that.
existing dataset:
UserId ,GameId , win ,loss, drawn
1 1 1 4 0
1 2 4 3 0
2 3 1 0 0
1 4 1 0 0
how can I use a get the following result:
the GameID is a PKI and below GameID is the name i wanted for
the count NOTE: GameID below does not Equal gameID above
UserId ,GameId, win ,loss, drawn
1 1 1 4 0
1 2 4 3 0
1 3 1 0 0
-
May 14th, 2003, 10:41 AM
#6
Sleep mode
You might need to read more about dataview then to filter your data .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|