Asp.net - RecordCount Vs BOF/EOF Evaluation

May 12, 2011

I'm maintaining a set of code that has a wrapper class for SqlDataAdapter to load a System.Data.DataTable. It has a generic function to determine if the DataTable "hasRecords". I know it's a minor issue, but out of curiosity... Which is the faster method to use?

Existing:

Public ReadOnly Property hasRecords() As Boolean
Get
hasRecords = CBool((CBool(BOF = True) And CBool(EOF = True)) = False)

[code]....

If RecordCount is defined as a fixed value in as a recordset property I would think the count would be faster as a single eval vs the multipart conversion/eval BOF/EOF method it is using.

View 2 Replies


ADVERTISEMENT

[2008] Reproduce ADODC RecordCount In .NET Using Databindings?

Jan 16, 2009

I am porting a college project made in VB6 to VB.NET, which I am quite new to. I'm finding data bindings a little more frustrating than the ADO controls VB6 had. Here is an example of RecordCount being used in the old code, from the login screen:

Private Sub cmdLogon_Click()
If txtID.Text = "" And txtPassword.Text = "" Then

View 3 Replies

How To Do Code Evaluation

Feb 6, 2012

how to clean up the code, perhaps some recommendations on how to have it working optimally. Maybe even some links for areas in particular that I should be more aware of. What functionality have I not employed here that I should have?

Option Strict On
Imports System.Data.SqlClient
Public Class Expenses
Private MotorItems As New List(Of String)

[code].....

View 13 Replies

BackgroundWorker - Property Evaluation Failed

Feb 23, 2009

I'm passing a collection of links to a background worker. The first time I use it in my bgw, it works fine, the second time (after a thread sleep) it says property evaluation failed.

View 1 Replies

Conditional References Of Two Strings Seem To Be Doing Evaluation Instead

Oct 6, 2011

This is a bit of an odd one. Last week, this code worked as expected. This week, it does not. Example:

[Code]...

View 4 Replies

LINQ Short-circuit Evaluation In .NET?

Jan 5, 2012

We had a Nullable object must have a value error today on this line of code:list = From x In Me Where x.FooDate.HasValue AndAlso x.FooDate.Value.Date >= barDate

Funny thing is that I feel sure this used to work fine (and there has always been a sprinkling of null values in the underlying data). And logically it looks fine to me. The check for HasValue and the AndAlso look as if they're going to shield us from any Null danger.But it seems suddenly they're not. Am I missing something?OK, we can correct it to this, which eliminates the error:

list = From x In Me Where If(x.FooDate.HasValue, x.FooDate.Value.Date >= barDate,False)

But this looks to me less readable. In simplifying the above code to shorten the line I left out a crucial chunk of the code. The original problem should have read something like:

list = From x In Me Where x.FooDate.HasValue AndAlso x.FooDate.Value.Date >= fromDate And x.FooDate.Value.Date <= toDate

Because of the rules of shortcircuiting and operator precedence (as outlined in an answer to a long ago question of my own) I needed to add brackets round the second part of the instruction in order to stop LINQ evaluating the second x.FooDate.Value.Date:

list = From x In Me Where x.FooDate.HasValue AndAlso (x.FooDate.Value.Date >= fromDate and x.FooDate.Value.Date <= toDate) LINQ really does obey AndAlso and force me to look more closely at the original problem.

View 2 Replies

VS 2008 Property Evaluation Failed

Jan 7, 2011

My problem is I'm am trying to connect to a db2 table but no matter which connection type is use (adodb, oledb, db2) I keep getting the same error message when I get to this statement: objConn = New (adodb, oledb, db2).connection. "Property evaluation Failed".

View 7 Replies

VS 2010 - Evaluation With Star Ratings

Feb 13, 2011

I have a system created last year called the "Faculty Performance Evaluation System" in which the students will evaluate their instructors according to their performance. Now I'm trying to change that and the questions are to be loaded from the database. Here are my options for displaying the questions and the rating stars:

1. Using lots of labels placed in the form as well as images(stars)But this will consume lots and lots of codes and the number of questions is limited. Also, I can't do a control array in vb.net unlike in vb6 so it will be very long...
2. Using listview/datagrid?- is it possible to create this project with a listview containing the stars in the 2nd-6th column?, If so, how?

(It's ok to lose my background but the stars can't. Since using this kind of control will make my number of questions unlimited)- then, if I'm to choose this option, how would I save the results into my database? (fields: studnum, category, quesnum, rating)

View 2 Replies

Asp.net - {Property Evaluation Failed.} When Exporting Data To Excel ?

Oct 3, 2011

I am using the code below to export records in a datatable to an excel file using EPPlus.

Dim excelPackage = New ExcelPackage
Dim excelWorksheet = excelPackage.Workbook.Worksheets.Add("DemoPage")
excelWorksheet.Cells("A1").LoadFromDataTable(dt, True)[code]....

However, after walking through the code block, at Response.End(), I get an exception {Property evaluation failed.}

Update:

The error log is:

ERROR: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at Reporting.Page_Load(Object sender, EventArgs e) in C:Reporting.aspx.vb:line 38

View 1 Replies

Get The Current Number Of Usage Days, Unique Usage Days, Etc In An Evaluation License Using CryptoLicensing Generator?

Jan 25, 2010

Get the current number of usage days, unique usage days, etc in an evaluation license using CryptoLicensing Generator.

View 1 Replies

Game Programming :: Evaluation Of New Game?

Apr 2, 2009

I have written a small game; my first attempt in VB2008ExprEdition.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved