467,074 Members | 950 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

Few questions about dataGrid

helo
i have few questions about working with datagrid

1. after i got help from this forum i succeded to move between columns by preesing the enter key, now my questio
is how can i decdied which column to move to

2. i bind my datagrid with a stored procedure from my sql database (by using dataadapter,dataset ...) and i need to send a parameter to the stored procedure, how can i do it? the wizard that opens when i drag the dataadapter doesn't give this option..

thank you all
Nov 16 '05 #1
  • viewed: 1087
Share:
1 Reply
1) You can use the CurrentCell property to determine where you moved to .
It has a rowIndex and a columnIndex so you can use the columnINdex to
determine this
2) You aren't binding to a Stored Procedure you are binding to a
datatable/DataReader/Dataset that was generated from a Stored proc. In
general, the select command (and the rest provided that they could be
generated) can be overridden by you. You can just change the select command
and here's how to call a Stored Proc and use Parameters
http://www.knowdotnet.com/articles/storedprocsvb.html
Now, you can still use the Update/Insert/Delete commands that were
genereated or you can build your own. All you need to do is at the
beginning, change the Select command sometime before you call .Fill, and add
the parameter(s) to the command's parameters collection and make sure you
set the commandType to CommandType.StoredProcedure.

The update/delete/insert commands (provided they were generated) will add
the params and the column mappings.... but you can use whatever select
command you want and whatever other commands you want with the same adapter,
unless of course you are using a CommandBuilder (if you are, don't - they
are really lame) which infers its update logic from the select command.

HTH,

Bill

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Gidi" <sh*****@hotmail.com> wrote in message
news:43**********************************@microsof t.com...
helo,
i have few questions about working with datagrid:

1. after i got help from this forum i succeded to move between columns by preesing the enter key, now my question is how can i decdied which column to move to?

2. i bind my datagrid with a stored procedure from my sql database (by using dataadapter,dataset ...) and i need to send a parameter to the stored
procedure, how can i do it? the wizard that opens when i drag the
dataadapter doesn't give this option...
thank you all

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Gidi | last post: by
2 posts views Thread by Hemang Shah | last post: by
reply views Thread by smith.felicity@gmail.com | last post: by
9 posts views Thread by eitan | last post: by
10 posts views Thread by Kejpa | last post: by
1 post views Thread by Brian | last post: by
3 posts views Thread by melton9@hotmail.com | last post: by
reply views Thread by Newish | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.