Re: My Book is Incomplete Regarding SQL Commands ;-(



LOL

Yeah, I went to my local library today and picked up "Visual
Basic .NET in 21 Day". I normally do not like the 21 days books, but
low and behold there was a swell example and explanation of how to
access and manipulate a DataSet once created.

My DataSet is "DsMyMonthlyIncome1"

Dim objTable As DataTable
objTable = DsMyMonthlyIncome1.Tables("Budget Items")

Dim objRow As DataRow
For Each objRow In objTable.Rows
If objRow.Item("FirstName") = "" Or
objRow.Item("LastName") = "" Or objRow.Item("Address1") = "" Or
objRow.Item("City") = "" Or objRow.Item("State") = "" Or
objRow.Item("Zip") = "" Or objRow.Item("Phone") = "" Or
objRow.Item("Email") = "" Then
MsgBox("Please enter your personal information under
File->Client Information before continuing.")
MenuItem6.PerformClick()
End If
Next

MenuItem6 brings up a registration window with bound textboxes that
save information to my Access db.

Hope this helps someone struggling ;-)

-Dan

On Mar 21, 12:56 am, "RobinS" <Rob...@xxxxxxxxxxxxxxx> wrote:
Apparently you bought the wrong ones. ;-)

Robin S.
---------------------------"pooba53" <poob...@xxxxxxxxx> wrote in message

news:1174446783.089017.248070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I appreciate the book suggestions. Thanks.

What I really need is some sample code that addresses my original
question. I've spent enough $$$ on books presently and they were all
supposed to be wonderful ;-)

-Dan

On Mar 20, 5:59 pm, "William \(Bill\) Vaughn"
<billvaRemoveT...@xxxxxxxxxx> wrote:
I agree, David's book is great. I wrote a book that maps to the original
Visual Studio but not to VS 2003.
Visual Studio (VB.NET) has code generators in each of its versions that
automatically generates the code (including the SELECT query) when you
drag
and drop data tables or Data Source tables on the form. One approach I
use
in my book is to dig into the generated code (click "show all files" in
the
solution explorer). Here you will see a lot of code--used to
Create a Connection object and pass in a ConnectionString to address
your database.
Create a DataAdapter or TableAdapter (depending on the version) to
manage the database table you reference.
Create a set of Command objects--one each to Select, Insert, Update
and
Delete rows (SelectCommand, InsertCommand etc.)
Use the DataAdapter or TableAdapter Fill method to execute the
SelectCommand, return a rowset and populate a DataTable
Bind the DataTable returned to the TextBox or DataGridView
control(s) on
your form.
Build the UI needed to navigate and launch the Update method on the
DataAdapter that posts changes to the database (and call the
InsertCommand,
DeleteCommand and UpdateCommand).

Yep, my latest book can help too, but mostly if you're targeting SQL
Server
(any version).
There are also walkthroughs in the documentation that can help as well.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speakerwww.betav.com/blog/billvawww.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visitwww.hitchhikerguides.nettoget more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Jim Brandley" <Jim.Brand...@xxxxxxxxxxxxxxxxxx> wrote in message

news:eVSeorzaHHA.2300@xxxxxxxxxxxxxxxxxxxxxxx

David Sceppa wrote a book called "Microsoft ADO.NET". It was a big
help to
me when I was getting started. He has lots of examples and pointers
for
performance.

"pooba53" <poob...@xxxxxxxxx> wrote in message
news:1174426969.138413.75590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The book I'm learning VB .NET from barely scratches the surface of
ADO.NET. I have a working application that has a database connection
(to Access), a data connection OlDbConnection1, a data adapter
OlDbDataAdpater1, and my text boxes are working as expected when
bound
to the Access fields. The book has "Wizards" do all the "magic".

What my book does NOT cover is how to use the above items to generate
sql commands and capture the results. Sort of pitiful.

I know SQL and have used it with Linux, PHP, and MySQL. I just don't
understand the most common thing in the realm of getting information
from a database using VB .NET and VS 2003.

I do have a dataset created too called "Data1".

I already have everything set up, I just don't know the syntax to
create a select statement and capture the results!

Thanks for putting up with my dunce cap...
-Dan


.



Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Getting started in IT.
    ... Have ordered both books. ... MCITP SQL Server 2005 Database Administration All-in-One Exam Guide ...
    (microsoft.public.cert.mcdba)