vb.net

Converting an empty string to a date, and then back.

I'm trying to do some validation testing in VB.NET. If Entity.WeekEndDate.ToString = String.Empty Then ErrorList.Add(New cValidationError("id", "Incorrect Week End Date")) Where WeekEndDate is of type Date. When I originally build the object, how can I insert a value into WeekEndDate that will generate an empty string(ie....

vb.net insert record into dataset cell from a loop

For j = 0 To wcData.Tables(0).Rows.Count - 1 For i = 900 To 1700 wcData.Tables("db").Rows(j)("range") = i Next Next trying to insert "i" into each column cell of "range" any suggestion. Thanks. ...

Convert a LINQ Query Resultset to a DataTable

How can i write this query with LINQ to a FoxPro database? SELECT count(*) FROM Table group by item1 I wrote it as below, but it doesn't work Dim Query Dim dt As New DataTable Dim da = New Odbc.OdbcDataAdapter("SELECT * FROM table1",connection) da.Fill(dt) Query = (From row In dt.AsEnumerable Select row_ Group By item1 ...

How to Load a Generic class without loop

ok this is the thing I have right now which is working quite well except its a bit slow: Public Function GetList() As List(Of SalesOrder) Try Dim list As New List(Of SalesOrder) Dim ds As DataSet ds = cls.GetSalesOrderList 'CLS is the data access class For i = 0 To ds.Tables(0).Rows.Count - 1 Dim row As Data...

Save/retrieve a file in a project directory, not the output directory

I'm creating a simple .NET console application where I want to save a file in a folder that's part of the root project, like so: SolutionName.ProjectName\TestData\. I want to put test.xml into the TestData folder. However, when I go to save my XDocument, it saves it to SolutionName.ProjectName\bin\x86\Debug Console\test.xml. What do I...

MODI gives BAD LANGUAGE error for English documents

I have been using MODI component of Office 2007 for extracting text from TIFF documents. It was working fine untill today when I executed my code it gave the error of "OCR: Bad Language" I have not made any changes in code so in tif documents.I am scanning English documents. mdoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, True, True) ...

DataGrid VB.NET 2005 URL writing

Hi, I have DataGrid and I have a hyperlink field but I want to send some information with this link by using URLwriting. I have tried this, but it's not working. So, please help me out. ~/Logout.aspx?ID="row.Cells(1).Text" I want to send the value of data grid's column but I am getting "row.Cells.Text" instead of receiving the value ...

How can I get all folders in a drive?

How can I retrieve a list of all folders in a drive in VB.NET? ...

Building SOAP message with XMLDocument VB.NET

I am having some problems building a properly formatted SOAP message using XMLDocument in VB.NET(C# answers are fine though). I am using the following code to manually create my SOAP message, what is happening is that the namespace prefix of the soap:Header and soap:Body are being stripped in the output XML: Dim soapEnvelope As XmlElem...

Add Multiple trend lines to single chart using asp.net chart control ?

using FinancialFormula we can get only one RegressionType like Linear , Exponential , Logarithmic , Power trend line will display in single chart. Is it possible to add all these four regression types to chart. How can we do that using asp.net chart control? or is there any free chart control that support these? ...

LINQ: "Group Join" functionality joining three tables

I've searched previous questions and can't seem to find what I'm looking for, so please excuse the n00b LINQ question... I'm working on becoming familiar with LINQ, and getting my head around the syntax and usage. In my exercises, I put together the following query: Dim r2 = From cust In cData.Customers _ Group Jo...

How would I read an ascii string of hex values in to a byte array?

How would I copy/convert a string containing an ascii representation of hex values in to a byte array containing the actual hex values? For example, I have a variable containing the hex values delimited by spaces (I can change the delimiter): myString = "24 01 66 09 13 2F 1E 00 00 4E" I want to put those values into a byte array: Dim...

Archiving Docments

was wondering if there is .net open source Soultion for doing the following : -scanning papers -storing them in db with data -searching , viewing etc. windows /web is accepted thanks in advance ...

VB.NET Default Namespace - problems using it and not using it... What is the way around this issue?

Hi, I am building an MVC2 website using VB.NET. I had a root namespace defined for the project but blanked it out because I wanted to have full control over the namespace for each class in the project. The reason I require this control is that I define a bunch of htmlhelper extensions and want them be in the same namespace (System.Web...

Understanding the VB.Net Tooltip control

Hi there! I'm using a ToolTipto display some additional info on my form components, and I'm handling the display by myself. That is I have a function that does : Public Sub ShowTip(ByVal sender As Control) Dim Pair As String() = sender.Tag.ToString.Split(New Char() {";"c}, 2) If Pair.GetLength(0) = 1 Then MyToolTip.Too...

Updating the UI based on the programmatic values in windows application.

Hi all, I am having a windows application that is developed using VB.net.I can select particular directory, the system has to give the list of files(count) under the directory and also it has to show the list of files that are parsed in a text box. I have written the code to get the filecount as well as fies that are parsed . I am ab...

Convert VB.NET code to C#

Hi, Is there a library that I can use to convert VB.Net code into C#? There is http://codeconverter.sharpdevelop.net/ but i don't want to use it from a web service. ...

How to create Object (label, button) using Code

How to create Object (label, button) using Code? ...

How to create var with loop (ex: Dim a1,a2,a3 with loop)

Dim count As Integer For count = 1 To 10 Step 1 Dim But+count As New Button myButton+count.Width = 100*count myButton+count.Height = 20*count myButton+count.Top = 50 *count myButton+count.Left = 50*count Me.Controls.Add(myButton+count) Next Dim But+count As New Button => How t...

Should a function that periodically returns bitmaps re-use them?

I have a function that returns a bitmap meant to be used as background in a panel, and occasionally I'd have to call it to create a new background based on parameters. (Since there are two drawing functions for this panel (the background doesn't need to be changed as often as the foreground) it's not a matter of just drawing on the Pain...