471,108 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 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 2748
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steve Teeples | last post: by
5 posts views Thread by JimmyKoolPantz | last post: by
1 post views Thread by weird0 | last post: by

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.