Conditional References Of Two Strings Seem To Be Doing Evaluation Instead
Oct 6, 2011This is a bit of an odd one. Last week, this code worked as expected. This week, it does not. Example:
[Code]...
This is a bit of an odd one. Last week, this code worked as expected. This week, it does not. Example:
[Code]...
I have code that runs a deal.deal is a series of conditional steps [e.g., pay Fee1 from Account2 if (Variable5 > 500, Variable5 / 2, 0)].
These conditional steps are stored as strings in an access database.The conditional part can be extremely complex.
What is the best way to get my code to understand the conditional part?Do have to write some huge parser?
Is there a function that can do this for me(something similar to application.evaluation function in VBA)?Or do I need to approach this in an entirely different way?
I have Crystal Reports 2008 installed on my win7 laptop but when i go to insert references from my application settings the CrystalDecisions references are missing and im not able to find them. Note: they do exist in my "c:windowsassembly" folder.
View 3 RepliesSay I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 RepliesI'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.
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].....
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 RepliesWe 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.
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 RepliesI 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)
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
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 RepliesI have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
I'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
Get the current number of usage days, unique usage days, etc in an evaluation license using CryptoLicensing Generator.
View 1 RepliesI have written a small game; my first attempt in VB2008ExprEdition.
View 2 RepliesThe template I use for all of my pages looks at the style.css to get the header image. I want to change it so that it looks at who logs in and displays an image based on who they are.
View 3 RepliesI have been looking for examples to find the string between two strings. This top one works fine;
Public Sub ReadData(ByRef keywordStart As String, ByRef keywordEnd As String, ByVal filename As String)
Using reader = New StreamReader(filename)
[Code].....
Now the first one is fine - Ext_Volume is result of the string between the strings <Volume> and </Volume>. <Volume> and </Volume> are unique so this is straight forward.
However the second one - "^FDExp:" is unique, but "^FS" is not unique. There are occurances of "^FS" before and after "^FDExp:".
How do I get the string to search AFTER the occurrence, not before etc?
Dim str As String
Dim str2 As Array
str = "blabla duhduh"
str2 = str.Split(" ")
Say the string is something like
bla bla bla bla (cat) bladfdskdfd dsgdsdksf (dog)
dfdshfdskdskfsdfkhsdf sdkfhdsfkdf (kathy) fdsfhdskfhdsfkd (doggy)
I want a generic.list (of string) containing
cat
dog
kathy
doggy
How to do that with regular expression in vb.net
Later I want to do something more complicated like getting all strings between "url":" and ", from this strings
[Code].....
Is there an easy way to find a certain string within a string and then return the strings that you find as an array?I have written this:
Public Function FindStrings(ByVal strSourceString As String, ByVal strStartString As String, ByVal strEndString As String) As String()
Dim StringStartposition As Integer
Dim StringEndPosition As Integer
Dim Currentposition As Integer = 1
[Code]...
I have this string called time. It's value is in this format: HH:MM:SS The numbers change, but the format stays the same. I want to separtate the code into 3 strings Hour, Minutes, Seconds.
View 2 RepliesIs there a way to set a variable in VB.NET in an IF statement. I would like to do the following:
[Code]...
Is there some way I can get the last "ElseIf" to work? I know I can re-write it to get it to work but is there some syntax that will make it work the way it is?
In this query against a datatable i'm trying to do some conditional filtering.The check against Timeband(index N) should only be done when the Index exists. (the base code only had three item fields, i've converted them to a simple list)
Dim res As DataTable =
(
From dr As DataRow In dtTimedRow.AsEnumerable()
Select dr
[code]....
The above code triggers an Exception if the count = 1. It executes the code next to imeBands.Count > 1 which it should not. What would be the correct solution for this code.In the mean time i've added a simple filter function.
I am very new to VB and was thrown into the water with a very big project done in VB.What I am trying to do is this:1. The initial search is for locations within an area of 200 miles.2. If no locations are returned search for locations within 500 miles.Seems easy enough but I cannot seem to figure out how to do part two.If thunder.apps.ddr.franchiseconnect.bll.Current.Settings.Location.hasValue Then'we run this procedure to get the location's value from ZIP db for lat, long assignment
View 13 RepliesI have a javascript src that i need to add to some of the pages in a site.
for example <script type="text/javascript" src="http:abcxyz.com/zzz"></script>
I want to add this conditionally on a .ascx page - if the Request.ServerVariables["SCRIPT_NAME"] ends with certain criteria.
The ascx language is vb, and there is no code behind.
I have a datagrid in asp.net and vb.net, and i'd like to show the status of the item of a certain row with two possible icons.I have a function that checks validation and returns a boolean value that uses some fields of the datagrid.
View 2 RepliesimgTitle.Image = My.Resources.title
If imgTitle.Image Is My.Resources.title Then
MsgBox("Success")
Else
[code]....
I have some textboxes on a report in VB 2005. There are three "Status Types": A, B and C. I want an expression like this to work on a number of textboxes:
[Code]...
I have two combo boxes: cboRepairCategory (plumbing, landscaping, etc) and cboVendors. I am using Stored Procedures in SQL to store the data from my database and then load them into the combo boxes.The cboRepairCategory will be loaded first. Once the user has selected what type of repair it is I want it to restrict the amount of vendors that can be selected, so instead of saying:CREATE PROCEDURE dbo.up_Fill_Vendor_Combo
AS
SELECT VendorID, CompanyName
FROM Vendors
[code].....
I would select only the vendors that have the RepairType of say Landscaping, so thecboVendor would load now only Vendors with Landscaping instead of all vendors.My question is this: Is this done in SQL in my Stored Procedure or is it done in VB in my functions for my combo boxes. I've never tried this before I am totally lost on it. I have fiddled with the code on both ends but to no avail.