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

Newbee Question - Updating Data With a DataGridView

I'm new to VS2005 and want to simply update my data with the dataGridView
that was generated when I draged my query from the Data Sources Pane. I
think I may need to create a Data Adaptor but I'm not sure? The other think
I saw was to implement IEditable? How would I do that? Where in my code
woudl I do that considering I am not creating the DataGridView via code?

I know this is probably the easist thing to do I just don't know how?

Thanks in advance,
Apr 20 '06 #1
7 2871
I just wanted to make sure I was clear, this link shows you how to do this
programmatically:

http://msdn2.microsoft.com/en-us/lib...6z(VS.80).aspx

Yet I want to use the visual capability of VS and not set every parameter
myself. This seems so much more complicated than in VB6 where you set the
updatable property of the datagrid!!! Why is this such a pain to do?

"Greg P" wrote:
I'm new to VS2005 and want to simply update my data with the dataGridView
that was generated when I draged my query from the Data Sources Pane. I
think I may need to create a Data Adaptor but I'm not sure? The other think
I saw was to implement IEditable? How would I do that? Where in my code
woudl I do that considering I am not creating the DataGridView via code?

I know this is probably the easist thing to do I just don't know how?

Thanks in advance,

Apr 20 '06 #2
Well, you can't expect Visual Studio to do everything for you, simply
because there are so many possible combinations of things programmers want
to do. It provides some excellent tools that will save you a lot of time,
but at some point you have to know what it is that it is doing for you, and
be able to work with it.

Basically, here's a clue for you. When you did that dragging and dropping,
Visual Studio was busily writing code that defines a number of classes,
including strongly-typed DataSets, DataTables, and DataAdapters. It is a
DataAdapter that provides the link between the DataSet and the underlying
Data Store (in this case a database). And even though Visual Studio didn't
need to include code to update the database, delete or insert new records,
into it, in order to populate your DataSet for you, it did write that
functionality in there. Microsoft anticipated that you might want to do
something like that.

So, you just need to look at the classes that were developed for you, find
the functionality you need, and use it.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Greg P" <gs*@newsgroups.nospam> wrote in message
news:64**********************************@microsof t.com...
I just wanted to make sure I was clear, this link shows you how to do this
programmatically:

http://msdn2.microsoft.com/en-us/lib...6z(VS.80).aspx

Yet I want to use the visual capability of VS and not set every parameter
myself. This seems so much more complicated than in VB6 where you set the
updatable property of the datagrid!!! Why is this such a pain to do?

"Greg P" wrote:
I'm new to VS2005 and want to simply update my data with the dataGridView
that was generated when I draged my query from the Data Sources Pane. I
think I may need to create a Data Adaptor but I'm not sure? The other
think
I saw was to implement IEditable? How would I do that? Where in my
code
woudl I do that considering I am not creating the DataGridView via code?

I know this is probably the easist thing to do I just don't know how?

Thanks in advance,

Apr 20 '06 #3
Hi,

As you know, you can use a DataAdapter to update all the newly added rows,
modified rows and deletions to the database. You needn't implement the
IEditable interface. Here is a good article for your reference.

http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/databindingadonet.asp

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 21 '06 #4
Thanks for the time, I guess the question is where is the dataAdaptor that
the wizard creates? How do I access the update capabilities? I see a
tableAdaptor that is created, is that what I'm looking for? If not what is
the name of my dataAdaptor and where does it live?

Thanks
Greg

"Kevin Spencer" wrote:
Well, you can't expect Visual Studio to do everything for you, simply
because there are so many possible combinations of things programmers want
to do. It provides some excellent tools that will save you a lot of time,
but at some point you have to know what it is that it is doing for you, and
be able to work with it.

Basically, here's a clue for you. When you did that dragging and dropping,
Visual Studio was busily writing code that defines a number of classes,
including strongly-typed DataSets, DataTables, and DataAdapters. It is a
DataAdapter that provides the link between the DataSet and the underlying
Data Store (in this case a database). And even though Visual Studio didn't
need to include code to update the database, delete or insert new records,
into it, in order to populate your DataSet for you, it did write that
functionality in there. Microsoft anticipated that you might want to do
something like that.

So, you just need to look at the classes that were developed for you, find
the functionality you need, and use it.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Greg P" <gs*@newsgroups.nospam> wrote in message
news:64**********************************@microsof t.com...
I just wanted to make sure I was clear, this link shows you how to do this
programmatically:

http://msdn2.microsoft.com/en-us/lib...6z(VS.80).aspx

Yet I want to use the visual capability of VS and not set every parameter
myself. This seems so much more complicated than in VB6 where you set the
updatable property of the datagrid!!! Why is this such a pain to do?

"Greg P" wrote:
I'm new to VS2005 and want to simply update my data with the dataGridView
that was generated when I draged my query from the Data Sources Pane. I
think I may need to create a Data Adaptor but I'm not sure? The other
think
I saw was to implement IEditable? How would I do that? Where in my
code
woudl I do that considering I am not creating the DataGridView via code?

I know this is probably the easist thing to do I just don't know how?

Thanks in advance,


Apr 21 '06 #5
The code for it should be in your project. If you see an XSD file for your
DataSet, expand it and look at the Designer for it, or use the Class View to
examine the class structures.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Greg P" <gs*@newsgroups.nospam> wrote in message
news:EB**********************************@microsof t.com...
Thanks for the time, I guess the question is where is the dataAdaptor that
the wizard creates? How do I access the update capabilities? I see a
tableAdaptor that is created, is that what I'm looking for? If not what
is
the name of my dataAdaptor and where does it live?

Thanks
Greg

"Kevin Spencer" wrote:
Well, you can't expect Visual Studio to do everything for you, simply
because there are so many possible combinations of things programmers
want
to do. It provides some excellent tools that will save you a lot of time,
but at some point you have to know what it is that it is doing for you,
and
be able to work with it.

Basically, here's a clue for you. When you did that dragging and
dropping,
Visual Studio was busily writing code that defines a number of classes,
including strongly-typed DataSets, DataTables, and DataAdapters. It is a
DataAdapter that provides the link between the DataSet and the underlying
Data Store (in this case a database). And even though Visual Studio
didn't
need to include code to update the database, delete or insert new
records,
into it, in order to populate your DataSet for you, it did write that
functionality in there. Microsoft anticipated that you might want to do
something like that.

So, you just need to look at the classes that were developed for you,
find
the functionality you need, and use it.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Greg P" <gs*@newsgroups.nospam> wrote in message
news:64**********************************@microsof t.com...
>I just wanted to make sure I was clear, this link shows you how to do
>this
> programmatically:
>
> http://msdn2.microsoft.com/en-us/lib...6z(VS.80).aspx
>
> Yet I want to use the visual capability of VS and not set every
> parameter
> myself. This seems so much more complicated than in VB6 where you set
> the
> updatable property of the datagrid!!! Why is this such a pain to do?
>
> "Greg P" wrote:
>
>> I'm new to VS2005 and want to simply update my data with the
>> dataGridView
>> that was generated when I draged my query from the Data Sources Pane.
>> I
>> think I may need to create a Data Adaptor but I'm not sure? The other
>> think
>> I saw was to implement IEditable? How would I do that? Where in my
>> code
>> woudl I do that considering I am not creating the DataGridView via
>> code?
>>
>> I know this is probably the easist thing to do I just don't know how?
>>
>> Thanks in advance,
>>
>>


Apr 21 '06 #6
Kevin,

Thank you much for that article, it was very well written. I have a similar
issue now and if you think I should open a new thread I will. I am trying to
update a view. When you drag a datagridview that is created from a view I
understand that the .update method is not created. How do I add this? Where
do I place the code so that it isn't overwirtten? In general how do I update
through a view?

Thanks,
Greg P.

"Kevin Yu [MSFT]" wrote:
Hi,

As you know, you can use a DataAdapter to update all the newly added rows,
modified rows and deletions to the database. You needn't implement the
IEditable interface. Here is a good article for your reference.

http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/databindingadonet.asp

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 8 '06 #7
Hi Greg,

I have posted a reply on your new thread.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Teeples | last post by:
I have a form with two DataGridView controls. The form has linked to it an Access database with just two tables. The second table contains unique "child" data having a one-to-one relationship...
3
by: Rich | last post by:
Hello, If I want to update data displayed in a datagrideview/datagridview cell, how can I determine what cell I am updating? I am looking at the click event below, for example. Can I get...
2
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should...
5
by: JimmyKoolPantz | last post by:
Situation: I am writing a program that opens up a data file (file ext .dbf), imports the information into a dataset. The program also, searches through the dataset for key words ("company...
1
by: weird0 | last post by:
How can i update the data in my database directly through datagridview....? Can anyone tell me the appropriate links and what is the exact event in datagridview that handles it and some explanation...
2
by: snowdog17 | last post by:
Hello, I am a student and I need help with my VB task. I am currently using VB 2005 Express and I am fairly new to it, although I have programed in Delphi before....
2
by: hjin | last post by:
DataGridView takes very much time if I update a lot of data I have a DataGridView which has a DataSource (a DataTable) of 3000 rows. If I want to update one column of every rows in the DataTable,...
5
by: sreenu123 | last post by:
Hello All, Here's what I'm trying to do: I'm loading a datagridview with data from a dataset. I want to be able to update data in the datagridview and then save changes back to the dataset or...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.