|
-
Jul 28th, 2007, 11:24 PM
#1
Thread Starter
New Member
[2005] Graphical tools for ADO.NET
Is there any graphical tool i can use to conect to a Database using ADO.NET?
i've learn how to do it with code but i prefer using graphical tools if any.
By the Way, Can anyone tell me how to work with querys in ADO.NET for manupulation of a Datatable
any help will be apriciated
Thank you
__________________________________________________________________
Visit my other threads please, i need help with a new proyect
-
Jul 28th, 2007, 11:52 PM
#2
Re: [2005] Graphical tools for ADO.NET
Select Data -> New Data Source (or something close to that) from the main menu. Follow the wizard and it will create a typed DataSet with TableAdapters for you. You can then edit that DataSet in the designer by adding TableAdapters/DataTables, queries and DataRelations or deiting the existing objects. You can also add a typed DataSet to your project directly and building it up from scratch, without creating a Data Source, but I really don't see the point. If you're going to create a typed DataSet then let the IDE do as much of the work for you as you can.
-
Jul 29th, 2007, 12:13 AM
#3
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
thanks, now my proyect has a datasource, but how can i add, edit, delete data from here on?
I know SQL, so if you could tell me a way to execute a query when you push a button it would be even better.
by the way, can you tell me how to make a filter for the datatable linked to a datasource
thanks
-
Jul 29th, 2007, 01:15 AM
#4
Re: [2005] Graphical tools for ADO.NET
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 29th, 2007, 03:31 AM
#5
Re: [2005] Graphical tools for ADO.NET
That tutorial is no use for VS 2005 Data Sources and typed DataSets Rob.
Once you have created a Data Source and generated a typed DataSet you have a DataTable/TableAdapter pair for each table in your database. By default each TableAdapter has two ways to retrieve data: Fill to populate an existing DataTable and GetData to create and populate a new DataTable. Assuming that your DataSet is named MyDataSet and it contains a table named Person you would retrieve data like this:
vb.net Code:
Dim data As New MyDataSet
Using adapter As New MyDataSetTableAdapters.PersonTableAdapter
adapter.Fill(data.PersonTable)
End Using
or like this:
vb.net Code:
Dim table As PersonTable
Using adapter As New MyDataSetTableAdapters.PersonTableAdapter
table = adapter.GetData()
End Using
If you want to retrieve result sets that don't match a specific table in your database then you open the DataSet in the designer and add a new TableAdapter from the Toolbox. You then have the opportunity to configure the adapter via a wizard. You can enter the SQL query yourself or you can build it visually using the Query Wizard. Once the wizard completes a new DataTable/TableAdapter pair is added to your DataSet with the DataTable's schema matching that of your query's result set.
For more information on configuring and using TableAdapters I suggest you take a look here.
-
Jul 29th, 2007, 05:03 AM
#6
Re: [2005] Graphical tools for ADO.NET
No its not but like I posted its just an "intro" to ADO.NET
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 30th, 2007, 02:43 PM
#7
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
i already have done that using the properties of the datatable, what i need to know is how can i manipulate the datatable using SQL code.
Example, i want to execute a Query when i push a button. so this way i can edit, delete, add new data or even filter.
this is what i need to do, please tell how can i do it
-
Jul 30th, 2007, 06:24 PM
#8
Re: [2005] Graphical tools for ADO.NET
The DataTable has NewRow and Rows.Add methods for creating and adding new rows. Each DataRow has a Delete method. To edit a row you just set the Item property indexed by column name or number. You can't filter or sort a DataTable directly but you it has a DefaultView property that is type DataView. The DataView class provides a view of the data in a DataTable and has RowFilter and Sort properties.
Generally in VB 2005 you will simply bind your DataTable to a BindingSource and then bind that to your control(s). You then do all your data manipulation and navigation via the BindingSource. It provides properties and methods to filter and sort the data plus methods add new rows. You can also access individual rows via the Current or Item properties, which you can then edit or delete. It also provides navigation methods, like MoveNext and MovePrevious. I strongly suggest that you go to the MSDN library and read the documentation for the BindingSource class.
-
Jul 31st, 2007, 01:05 AM
#9
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
thanks for everything!
now i know how to do most things : add new, delete, and filter.
but i didn't understand how edit.
could you give an example please.
P.D.: i'm using
-
Jul 31st, 2007, 01:08 AM
#10
Re: [2005] Graphical tools for ADO.NET
Each row is an object. To edit a row just set the appropriate property, just like any other object.
-
Jul 31st, 2007, 01:29 AM
#11
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
yes, but what property is it and how do i use it (sorry for been so dump, i just stared using vb 2005)
-
Jul 31st, 2007, 01:37 AM
#12
Re: [2005] Graphical tools for ADO.NET
Whatever the name is of the column you want to set, that's the name of the property. The whole point of typed DataSets is that the classes are tailored to your data, so the members available is different every time. You get the value and set it the same way you do any other property.
The one thing to look out for is if your column can contain nulls. In that case you need to call the appropriate method to check for null first ro getting the property value will crash. You also use another method to set the field to null, e.g.
vb.net Code:
Dim myString As String
If myDataRow.IsMyColumnNull() Then
myString = Nothing
Else
myString = myDataRow.MyColumn
End If
'...
If myString Is Nothing Then
myDataRow.SetMyColumnNull()
Else
myDataRow.MyColumn = myString
End If
-
Aug 3rd, 2007, 10:39 PM
#13
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
thanx for the code, it can avoid crashing. Something i did'nt understand was what is mystring in this case? The string i insert?
Another thing is you never told me how to edit. I need to edit using data visualisation in a datagridview and textboxs, using the textbox to edit. both control are linked to the same bindingSource
At the begining i though it was working, because it show the changes made with the texbox in the datagridview but when i close the form it is erased, this mean it doesn't modify any record on the database.
Sorry if this causes you trouble but this is the first time making a somewhat serious program
-
Aug 4th, 2007, 03:44 AM
#14
Re: [2005] Graphical tools for ADO.NET
Did you follow the link I provided in post #5, or are you waiting for all the information to be provided here? That page has a link entitled "Saving Data", so it likely would be the place to look if your data is not saving. There's a wealth of information there so I suggest you start reading.
-
Aug 8th, 2007, 10:44 PM
#15
Thread Starter
New Member
Re: [2005] Graphical tools for ADO.NET
sorry, i dind'nt notice the link...
and i dont expect you to tell me everything, i like investigating on my own too.
Sorry you got the wrong image of me...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|