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

Few questions about dataGrid

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.