473,326 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Syntax Question - Novice Question

Hi,

I am filling a datagrid and I was wondering how I can test for "end of file"
and then make decisions based on that. I am still making the transition from
asp to asp.net.

Could someone help me with the syntax please?

Thanks in advance for youe answer

Sean

Dim Conn As OleDbConnection

Dim Rdr As OleDbDataReader

Try

Dim strConn As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="

strConn &= Server.MapPath("clicks.mdb") & ";"

Dim strSQL As String

strSQL = "select FirstName from newsletter where FirstName='sean'"

Conn = New OleDbConnection(strConn)

Dim Cmd As New OleDbCommand(strSQL, Conn)

Conn.Open()

Rdr = Cmd.ExecuteReader()

MyDataGrid.DataSource = Rdr

MyDataGrid.DataBind()

Catch exc1 As Exception

Label1.Text = exc1.ToString()

Finally

If Not (Rdr Is Nothing) Then

If Rdr.IsClosed = False Then Rdr.Close()

End If

If Not (Conn Is Nothing) Then

If Conn.State = System.Data.ConnectionState.Open Then Conn.Close()

End If

End Try

Nov 17 '05 #1
0 782

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Marian | last post by:
Hi, I am totaly novice in .NET and I am studying a book about this. There was mentioned "assembly". I did not understand, how function does it has . I would like to know the exact run of code...
7
by: Josh | last post by:
Hi All, I know this is a novice question that I should be able to solve through searching but I have Googled my fingers off and not found anything that seems to help. I have the following...
3
by: herrcho | last post by:
Here is the code.. #define NAME "MEGATHINK, INC" #define ADDRESS "10 Megabuck Plaza" #define PLACE "Megapolis, CA 94904" int main() { starbar(); printf("%s\n",NAME);
2
by: sean | last post by:
Hi, I am filling a datagrid and I was wondering how I can test for "end of file" and then make decisions based on that. I am still making the transition from asp to asp.net. Could someone...
2
by: sean | last post by:
Hi, I am trying to update an access database using an SQL statement, I keep getting an syntax error in update statment. I am passing in strChkBoxValue as a string value which is declared in...
2
by: Dmitry Sazonov | last post by:
I'm novice here and I'm sorry for stupid question. We are trying to understand web services architecture, is it better than TIBCO.Randevouz and does webservices fit our needs. I understand, I...
1
by: TwistedSpanner | last post by:
Hello all, For the record I am a complete java novice. I have to write a program to generate/output to screen 10 simple maths question and output a final score . The question is as follows ...
8
by: jennwilson | last post by:
I am a somewhat Novice Access user and have limited rather zilch programming skills. Problem: I am receiving the following error: "The expression you entered contains invalid syntax' In the...
5
by: Kelly | last post by:
I'm currently running VB6 on my MacBook pro via a virtual machine (Windows XP via Parallels Desktop for Mac). Unfortunately, my network does not allow me to print from within the virtual machine,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.