Hi Guys
Uphill about 5 years ago my career was going fairly well, but separation, family deaths and a bit of illness caused me to make a couple of BAD career decisions, and I ended up in a dead end job doing mainly vb 6, though it was the end as mid to late 30, but was recently handed a break, working with a forward thinking vb.net comp...
I have a DataGridView in a VB.NET app that I have limited to cell selection only. The control has two columns, the first is not editable, the second is editable. I have a ContextMenuStrip that provides some additional functionality and I am able to make it appear when an editable cell receives a right click and is not in edit mode. Based...
I'm loading data into a DataSet from an XML file using the ReadXml method. This results in two tables with the same name. One of the tables has a namespace and the other doesn't. I'm trying to reference the table with the namespace. Can anyone tell me how to do this?
Dim reader As XmlTextReader = New XmlTextReader(strURL)
Dim...
I have a Visual Basic .NET program which needs to open and close an Excel spreadsheet. Opening and reading the spreadsheet work fine, but trying to close the Excel 2007 application causes it to hang. It seems to close, but if you look in the task manager the application is still running. The code that I'm using to close it is
wbkData...
I have a block of product images we received from a customer. Each product image is a picture of something and it was taken with a white background. I would like to crop all the surrounding parts of the image but leave only the product in the middle. Is this possible?
As an example: http://www.5dnet.de/media/catalog/product/d/r/dress...
I have a ASP.NET/VB that had a GridView to display a list of users from the Users table.
I changed the primary key column name in the database from PKID to UserID and updated all the old references to PKID in the declarations and code behind. I also deleted the WebsiteCache folder which held the visual studio cache of the website.
When...
Is there any way to determine if an object is a generic list? I'm not going to know the type of the list, I just know it's a list. How can I determine that?
...
I just want to know how to validate (or clean) user input in ASP.NET MVC so that an HttpRequestValidationException will not be thrown regardless of the values submitted. For example, with a text input, if the user inputs <BR/>, it will cause an exception and the Yellow Screen of Death will be shown. I don't want that. I want to catch t...
I was just watching a video on MSDN Channel 9 which can be found here, about some of the new features in Visual Basic 10. Now I like most of the new features, some of which have been long awaited(auto properties and Collection Initializers), one that caught my eye was the multiline lambdas like in C#.
In the video he used an example ...
I have a class that downloads, examines and saves some large XML files. Sometimes I want the UI to tell me what's going on, but sometimes I will use the class and ignore the events. So I have placed lines of code like this in a dozen places:
RaiseEvent Report("Sending request: " & queryString)
RaiseEvent Report("Saving file: " & fileNa...
Hello -- I'm trying to get all property names / values from an Outlook item. I have custom properties in addition to the default outlook item properties. I'm using redemption to get around the Outlook warnings but I'm having some problems with the GetNamesFromIDs method on a Redemption.RDOMail Item....
I'm using my redemption session to...
Why would a stored procedure that returns a table with 9 columns, 89 rows using this code take 60 seconds to execute (.NET 1.1) when it takes < 1 second to run in SQL Server Management Studio? It's being run on the local machine so little/no network latency, fast dev machine
Dim command As SqlCommand = New SqlCommand(procName, CreateCo...
Hello,
I want to implement the iterator pattern in VB.net, which does not have the yield keyword.
Any ideas or links please?
...
I am working on a project where I search through a large text file (large is relative, file size is about 1 Gig) for a piece of data. I am looking for a token and I want a dollar value immediately after that token. For example,
this is the token 9,999,999.99
So here's is how I am approaching this problem. After a little analysis...
I am writing a searching function, and have thought up of this query using parameters to prevent, or at least limit, SQL injection attacks. However, when I run it through my program it does not return anything:
SELECT * FROM compliance_corner WHERE (body LIKE '%@query%') OR (title LIKE '%@query%')
Can parameters be used like this? or ...
Perhaps naively, I created a class (AdminDatabase) to handle connection to different MS-Access database files (see code at bottom). The purpose of the class was to allow retrieval of data from a MS-Access database and to manipulate the data. This works well. I can feed an instance of the AdminDatabase class an SQL statement and fill a ...
I would like to be able to cast a value dynamically where the type is known only on runtime.
something like this
myvalue = ctype (value, "String, Integer or Boolean")
the string that contains the type value is passed as argument and also read from DB.
And the value is stored as string in the DB.
Is this possible ?
Thanks in advance...
Given a Generic List of objects that contain a member variable that is a string, what is the best way to get the object that contains the string with the longest length?
ie.
assuming val1 is the string I'm comparing:
0 : { val1 = "a" }
1 : { val1 = "aa" }
2 : { val1 = "aba" }
3 : { val1 = "c" }
what needs to be returned is objec...
I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter.
The function looks like this:
Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean
'stuff
end function
and I'm Invoking it like this:
Dim result As Boolean = Reflector.Inv...
Just out of curiosity:
I know I can tell the compiler if I want a value to be interpreted as a certain numeric type, e.g. as Integer (32 bit signed) this way appending an "I" (type character) to the constant value:
Private Function GetTheAnswerAsInteger() As Integer
Return 42I
End Function
There's also "S" for Short or "D" for D...