473,605 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,dat aset ...) 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 1251
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.Sto redProcedure.

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*****@hotmai l.com> wrote in message
news:43******** *************** ***********@mic rosoft.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,dat aset ...) 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
1279
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 in my storedprocedure and sent it back to the application? 2. how can i make my dataGrid to display the last rows and not the first? 3. my last row is an empty row, how can i prevent that row from being created?
3
1516
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 to be at the last line, so i can see the last lines, how can i make it to be at the bottom? 2. i made a flag that disable the option to create several object from the same class so now if i press the same button few times nothing happens (as i...
2
1210
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 Comboboxes, can we display multiple fields ? For example in a Form of customers, we have a combo box to select the customer you want to change, so in that combo box, when they drop down, can we have it to display "First
0
257
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 looks like <asp:datagrid id="datagrid1" runat="Server" allowpaging="true" pagesize="25" autogeneratecolumns="False"> <asp:hyperlinkcolumn datanavigateUrlField="col3" dataNavigateUrlFormatString="{0}" dataTextField="col1"
1
1703
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? Application is across all sessions. Session is across all pages. ViewState is sort of like Session, but for only one page. <-- Correct statement? Session is stored between page requests, somewhere in mem or IIS files --
9
1302
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 some problems by using session("conMain"), see question 2). I don't know if it's a good thing to do, and not oppenning at each page the
10
1417
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 you'll get the left one autosized to it's content, I want to do that when I load the grid with data. 2. How do you sort the grid using a command button? When you click the column header you will get the grid sorted in ascending/descending order, my...
1
3204
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 datasources. Then at run time when I would bind a dataset to the grid it would display the tablestyle associated with the dataset. How do I do this in VS2005? 2) I do all my databinding to the datagridview at run time, but setup my columns as unbound...
3
1098
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 select "getNews"(the datatable) to show my data. 2.) I have this set up to a loop. So after I view my grid any updates in the loop causes the datagrid to go blank(ie gray box). Anybody know what I should add to make the datagrid correctly
0
1259
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 from a datatable and enable it to allow edits as well.
0
8415
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8286
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6742
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3912
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1537
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1270
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.