473,327 Members | 1,930 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,327 software developers and data experts.

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
1 1233
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gidi | last post by:
hello, i have a datagrid (in C#) and i have 3 questions: 1. how can i know how many rows my dataGrid(dataSet\DataAdapter) has? is it possiable to know with asking the database or i must do it...
3
by: Gidi | last post by:
hello i'm writing an appliction in C# and i have 2 questions: 1. i have a dataGrid which contains data from my DataBase, and when the dataGrid loads the scroll is at the first line and i want it...
2
by: Hemang Shah | last post by:
Hello I've few questions regarding ADO & C#: 1) Is it possible to view tata from multiple tables in the Datagrid control ? Most of the examples I see are only for 1 table. 2) In...
0
by: smith.felicity | last post by:
I have two questions about using the data grid and c# If one of my columns returned in my dataset is null I want another column to be used in the displayed column. So this is what my datagrid...
1
by: Sky | last post by:
Although I've been using C# for the last month or so, and accepting out of blind faith the ViewState, I do have some nagging questions about it... can you help verify the following statements? ...
9
by: eitan | last post by:
Hello, I am using Microsoft Visual Studio 2003 .NET. I have several question, please. 1) I have a connection to the database, which I create it at login, by application("conMain") (I have...
10
by: Kejpa | last post by:
Hi, I've just started using the datagrid and I have a few questions on it... 1. How do you autosize the columns to fit the content programmatically? When you double click between two columns...
1
by: Brian | last post by:
I've got a couple questions on the new Datagridview control in VS2005. 1) In the old datagrid control at design time I was able to add multiple tablestyles with columns from different...
3
by: melton9 | last post by:
I'm just getting into using datagrid and have a couple of questions. 1.)How do you get the grid to show the values of a datatable automatically? Currently I have to hit the + sign and then...
0
by: Newish | last post by:
Hi Couple of questions on datagrid 1) Is there a performance issue when using datagrid to display data from a datatable. 2) Is there a security issue when using datagrid to display data...
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...
0
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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.