Click here to Skip to main content
15,913,939 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to fetch data from database in Tree view Pin
dj.rock29-Oct-06 17:02
dj.rock29-Oct-06 17:02 
Questionfile upload asp control Pin
dhatchu27-Oct-06 15:43
dhatchu27-Oct-06 15:43 
Questionuploading excel file to web server Pin
nivasinfotech27-Oct-06 12:03
nivasinfotech27-Oct-06 12:03 
AnswerRe: uploading excel file to web server Pin
Tad McClellan27-Oct-06 16:33
professionalTad McClellan27-Oct-06 16:33 
AnswerRe: uploading excel file to web server Pin
Jerry Hammond27-Oct-06 17:38
Jerry Hammond27-Oct-06 17:38 
QuestionUse 2 different databases Pin
shapper27-Oct-06 8:07
shapper27-Oct-06 8:07 
AnswerRe: Use 2 different databases Pin
indianet27-Oct-06 13:04
indianet27-Oct-06 13:04 
AnswerRe: Use 2 different databases Pin
Jerry Hammond27-Oct-06 18:01
Jerry Hammond27-Oct-06 18:01 
shapper wrote:
' Define connection
Dim connection As New SqlClient.SqlConnection(connectionString.ToString)

' Define command
Dim command As New SqlClient.SqlCommand
With command
.CommandText = "GetRecords"
.Connection = connection
.CommandType = CommandType.StoredProcedure
End With

' Add command parameters
With command.Parameters
.Add(New SqlClient.SqlParameter("@Value", Value))
End With

connection.Open()
...
Create DataTable
...
connection.Close()



That pro'ly will not work if you're looking to use a Microsoft Access database.

Here's a bit of code for you that should help connect to your Access db.

/ Assumes connectionString is a valid connection string.<br />
using (OleDbConnection connection = <br />
  new OleDbConnection(connectionString))<br />
{<br />
    connection.Open();<br />
    // Do work here.


Remember to add the OleDb namespace with the following: using System.Data.OleDb; or all your coding will be for naught.

For further reading on the subject direct your browser of choice (I recommend IE7) to http://msdn2.microsoft.com/en-us/library/system.data.oledb.aspx[^]

Good Luck!
Jerry Hammond
Applications Instructor

"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus


Questionhey guys!!!!!!!! Pin
dhami_naresh27-Oct-06 7:22
dhami_naresh27-Oct-06 7:22 
AnswerRe: hey guys!!!!!!!! Pin
ednrgc27-Oct-06 7:27
ednrgc27-Oct-06 7:27 
QuestionCenter buttons, textboxes, and images Pin
kani9827-Oct-06 6:12
kani9827-Oct-06 6:12 
AnswerRe: Center buttons, textboxes, and images Pin
ednrgc27-Oct-06 7:31
ednrgc27-Oct-06 7:31 
AnswerRe: Center buttons, textboxes, and images Pin
indianet27-Oct-06 13:06
indianet27-Oct-06 13:06 
QuestionSetting asp.net Version number using installer projects Pin
Nick The Newbie27-Oct-06 5:58
Nick The Newbie27-Oct-06 5:58 
QuestionRe: Setting asp.net Version number using installer projects Pin
Nick The Newbie30-Oct-06 3:16
Nick The Newbie30-Oct-06 3:16 
QuestionImage Preview Pin
SiouxL27-Oct-06 5:58
SiouxL27-Oct-06 5:58 
QuestionXML, Runtime and Web.Config problem. How to solve this? Pin
shapper27-Oct-06 5:31
shapper27-Oct-06 5:31 
QuestionUnable to access IIS metabase? Pin
eggsovereasy27-Oct-06 4:43
eggsovereasy27-Oct-06 4:43 
QuestionAccessing images stored within a firewall?? Pin
Goalie3527-Oct-06 4:09
Goalie3527-Oct-06 4:09 
AnswerRe: Accessing images stored within a firewall?? Pin
Jim Conigliaro27-Oct-06 11:00
Jim Conigliaro27-Oct-06 11:00 
Questiondatagrid with checkboxes in C#.net(asp.net) Pin
vijay258327-Oct-06 3:44
vijay258327-Oct-06 3:44 
QuestionAbout Frames Pin
sribachana27-Oct-06 2:23
sribachana27-Oct-06 2:23 
AnswerRe: About Frames Pin
Tad McClellan27-Oct-06 16:37
professionalTad McClellan27-Oct-06 16:37 
QuestionDatagrid Problem Pin
monika_vasvani27-Oct-06 2:20
monika_vasvani27-Oct-06 2:20 
AnswerRe: Datagrid Problem Pin
sanjivji27-Oct-06 3:02
sanjivji27-Oct-06 3:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.