Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2008, 01:53 AM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to khempire
Default Looping record from database

I am a new runner database project which using C# and MS. Access.
How can I retrive data from db if I use one textbox for a criteria?

For example(VB.6)

strSql = "Select * From tbl_db Where dbUser = '" & txtUser.Text & "'"

If rst.recordset > 0 Then
 MessageBox ("Testing")
End if

Regards,

Just another step straight into coding.
 
Old January 9th, 2008, 05:34 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You will want to do some reading up on ADO.Net then. Things you will want to look for are OleDbConnection (practically the same as an old VB Ado.Connection), OleDbCommand (also practically the same as Ado.Command) and OleDbDataReader (similar to a record only forward ADO.Recordset).

/- Sam Judson : Wrox Technical Editor -/
 
Old January 9th, 2008, 09:01 PM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to khempire
Default

Can you give the example?
It seems pretty difficult for a new runner.
Thanks.

Just another step straight into coding.
 
Old January 10th, 2008, 05:11 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I don't plan on trying to reproduce things that are already available elsewhere on the internet. Try a quick search for "ADO.Net tutorial" - I found this one here: http://www.csharp-station.com/Tutori.../Lesson01.aspx

/- Sam Judson : Wrox Technical Editor -/
 
Old January 10th, 2008, 10:37 PM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to khempire
Default

Thanks.
It is useful website that I am looking for.

Just another step straight into coding.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating the record in database lwebzem ASP.NET 1.0 and 1.1 Basics 4 March 8th, 2006 09:40 AM
Updating the record in the database lwebzem ASP.NET 1.0 and 1.1 Basics 3 February 28th, 2006 07:57 AM
Looping through a record to populate stored proced busher ASP.NET 1.0 and 1.1 Professional 3 May 16th, 2005 04:36 PM
Adding record to database? werD420 Classic ASP Databases 5 January 20th, 2005 06:27 PM
Insert a record into a Database ersp Classic ASP Basics 3 May 9th, 2004 08:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.