Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

DataGrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Newbe - 14 Oct 2004 23:45 GMT
I need help in a bad way.  I have a form with a datagrid in it coming for a
Access DB.  I have 3 columns, StudentName, Address, Phone.  I am using
Me.bindingcontext(School11, "Student") to bind buttons like first, next ect...

I have a button Add/Edit and Update to Disk and Insert
I have no idea how to code this so I can add a record to the above table.  
Can someone please help me!
Rakesh Rajan - 15 Oct 2004 17:25 GMT
Hi Newbe,

Your issue is not very clear. Basically, to perform updates, you need a
command object, or use an adapter and a dataset. You set the connection, and
command properties to those objects and execute them. But I don't know which
portion you haven't got right.

Check out this walk thru from MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwl
kwalkthroughdisplayingdatafromsingletableinwindowsform.asp


Let me know if you need more help.

HTH,
Rakesh Rajan

> I need help in a bad way.  I have a form with a datagrid in it coming for a
> Access DB.  I have 3 columns, StudentName, Address, Phone.  I am using
[quoted text clipped - 3 lines]
> I have no idea how to code this so I can add a record to the above table.  
> Can someone please help me!
NewBie - 15 Oct 2004 17:45 GMT
I have my datagrid setup, I can see my table in my form and I have added a
connection and cfg the adapter.  Now I need to add data to it from a btnAdd.

> Hi Newbe,
>
[quoted text clipped - 18 lines]
> > I have no idea how to code this so I can add a record to the above table.  
> > Can someone please help me!
Rakesh Rajan - 15 Oct 2004 18:15 GMT
Hi,

I assume that you have a datagrid, and a dataset populated by a dataadapter
with data from the DB, and that any existing data in the DB is shown in it.

For updating the DB, just edit any existing row.
In order to insert, insert a new value in the row with a '*'.

Within the handlers for Update and Add button click events, call the
dataadapter's Update method, passing the dataset you use.

Let me know if you still have problems.

HTH,
Rakesh Rajan

> I have my datagrid setup, I can see my table in my form and I have added a
> connection and cfg the adapter.  Now I need to add data to it from a btnAdd.
[quoted text clipped - 21 lines]
> > > I have no idea how to code this so I can add a record to the above table.  
> > > Can someone please help me!
NewBie - 15 Oct 2004 19:19 GMT
You are right in you assumption.  I do have a DB that have existing data.  I
have no  clue how to do ''call the dataadapter's Update method, passing the
dataset you use."
The book I am using does not give me any info on how call the adapter.

> Hi,
>
[quoted text clipped - 37 lines]
> > > > I have no idea how to code this so I can add a record to the above table.  
> > > > Can someone please help me!
Rakesh Rajan - 15 Oct 2004 19:31 GMT
Hi NewBie,

One question - have you loaded data from the DB into the datagrid?

Regards,
Rakesh Rajan

> You are right in you assumption.  I do have a DB that have existing data.  I
> have no  clue how to do ''call the dataadapter's Update method, passing the
[quoted text clipped - 42 lines]
> > > > > I have no idea how to code this so I can add a record to the above table.  
> > > > > Can someone please help me!
NewBie - 15 Oct 2004 19:39 GMT
Yes I did using the fill method.

> Hi NewBie,
>
[quoted text clipped - 49 lines]
> > > > > > I have no idea how to code this so I can add a record to the above table.  
> > > > > > Can someone please help me!
Rakesh Rajan - 15 Oct 2004 20:15 GMT
Hi,

OK.

Make sure that both the adapter, and dataset is declared within the class
scope and not in a method. For this, just make sure that their declarations
are somewhere within the class definition but not within any method.

Now add an event handler to the Add button (double click on the Add button
in design time to do this). Within the handler, call the dataadapter's Update
method, passing the dataset name.
For eg:
myDataAdapter.Update(myDataSet);
, which assumes that 'myDataAdapter' is my dataadapter and 'myDataSet' is
the dataset.

Let me know if you need more help.

Regards,
Rakesh Rajan

> Yes I did using the fill method.
>
[quoted text clipped - 51 lines]
> > > > > > > I have no idea how to code this so I can add a record to the above table.  
> > > > > > > Can someone please help me!
NewBie - 15 Oct 2004 20:59 GMT
I will have to try it tonight due to I am at work now.  And thanks for all
your help  :)

> Hi,
>
[quoted text clipped - 72 lines]
> > > > > > > > I have no idea how to code this so I can add a record to the above table.  
> > > > > > > > Can someone please help me!
Rakesh Rajan - 15 Oct 2004 21:05 GMT
Anytime NewBie :)

Let me know your progress.

Regards,
Rakesh Rajan

> I will have to try it tonight due to I am at work now.  And thanks for all
> your help  :)
[quoted text clipped - 75 lines]
> > > > > > > > > I have no idea how to code this so I can add a record to the above table.  
> > > > > > > > > Can someone please help me!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.