vb.net

NHibernate 2.1 Example?

I am having problems finding an example project that uses NHibernate 2.1.0. Anyone know of some that are out there, or even open source projects that use it? ...

Using GetCurrentMethod in (supposedly) high-performance code

For logging purposes, some methods in our application include the following line: Dim Log As ILog = GetLog(Reflection.MethodBase.GetCurrentMethod().DeclaringType) I have what might be described as an irrational fear of reflection, which I try to keep in check. However, calls like this in methods that are executed potentially a hundred...

In C# adding SelectMany extends linq to a new monad type, how do I do the same thing in VB.net?

An old Yet Another Language Geek blog post explaining monads describes adding a SelectMany extension method to C# in order to extend the linq syntax to new types. I've tried it in C# and it works. I did a straight conversion to VB.net and it doesn't work. Does anyone know if VB.net supports this feature or how to use it? Here is the C#...

I'm currently using reflection to do this, is there a better way?

o will always come from an entiryRef/TEntity (from linq 2 sql) I'm ok with a c# or vb.net solution (I will convert it into vb.net if you can't) Public Function desc(Of t)(ByRef o As t, Optional ByVal PropPrefix As String = "desc") As String If o Is Nothing Then Return "" Else Dim bind = Reflection.BindingFlags.P...

Why does every form field in my generated PDF end with "-0" ?

So I have the following VB.NET code that creates a form field in a PDF using SyncFusion's Essential PDF module: Dim pdfField As New Pdf.Interactive.PdfTextBoxField(pdfDoc.Pages(iPage), "txt1") pdfField.Location = New PointF(50, 50) pdfField.Size = New SizeF(100, 10) pdfDoc.Form.Fields.Add(pdfField) This works great except for one thin...

How do I eliminate these order dependencies from my code

In ASP.Net Web Forms there are cases that I've come across that create order dependent code. As an obvious code smell I'm looking for solutions to solve this problem. A pseudo-code example would be: Calling Code :: Page.aspx protected void Page_Load(...) { var control = LoadControl("ControlX.ascx"); // Ugly since the control...

HTML Table displays random cell values outside of table.

I am using a string builder to set up an html table row by row so that it can be emailed. I currently gather my information from the database using a data reader and while dataReader.read, I use stringbuilder.Append to add each cell value to the table. The issue is that after about 200 rows, the html breaks and displays a cell value abo...

Can I page through grouped data in DataGridView?

I have a simple VB.NET 2008 app that helps users to edit fields in the database. Simple enough as a first "real" project in .NET, right? For one table, I am currently using a DataGridView so it can be edited straight up. However, instead of offering the user the entire table, I'd like to group the data by the 'CompanyNumber' column and ...

Creating a webbrowser control in a background thread in backgroundworker

Is it possible to create a WebBrowser control in a background thread in BackgroundWorker? Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork Using web1 As New WebBrowser End Using End Sub This throws the following error: Ac...

Linq2SQL Counts getting cached?

I've got a very simple data structure. I'm using SQLExpress with Linq2SQL and vb.net **ParentClass** parentId name **ChildClass** childId name parentId (foreign key to parent table) The dbml reflects these two classes, and has a oneToMany association. So far, so good. In my code, i'm trying to get the value as follows Dim count...

opening excel in vb.net error

what do you think is wrong with the commented line in my vb.net code below? it returns the error message "member not found". thank you. Public Function tae(ByVal SourcePath As String) Dim oxlApp As Excel.Application Dim oxlBook As Excel.Workbook Dim oxlSheet As Excel.Worksheet oxlApp = CType(CreateObject("Excel.Applica...

How to find auto-updating date-time fields that have been inserted into a Powerpoint?

I need to find and "fix" these fields (that were inserted with TextRange.InsertDateTime with the InsertAsField flag set to true). Word documents appear to have a nice Fields property that gives me centralized access to them, and I can find the representation in the .pptx file with 2007, but I can't seem to find anything in the PPT objec...

How do I handle user submitted data to ensure best practice programming?

I would like to know what are the best practice programming tasks in relation to users submitting data through a web form to a website. I am particularly interested in any C# or VB.NET commands that should be used through out the process from the moment the user hits the submit button until the data hits the database. I have been readi...

Using VB.net extract data from XML

This XML file is CONSTANTLY updated every 3 seconds.. <?xml version="1.0" ?> - <MotePacket> - <ParsedDataElement> <Name>amtype</Name> <ConvertedValue>11</ConvertedValue> </ParsedDataElement> - <ParsedDataElement> <Name>nodeid</Name> <ConvertedValue>5164</ConvertedValue> </ParsedDataElement> - <ParsedDataElement> <N...

Passing a list of system.guid as params to as SQL2008 sproc

I would like to pull a set of records in a SQL sproc by passing in a list of system.guid and also by passing in a list of integer keys. I can put the guids ihto a string, of course, but the question is - how do I quote the test values so they are recognized as UIDs by SQL In essence I was to DECLARE @pklist AS VARCHAR(1000) -- This ...

How to retreive data stored in a webserver DB using windows application in local machine

My local machine is using windows application for an appointment fixing .I want to retreive data from webserver DB which also does appointment fixing by online for the same organisation.So I want both these to work in co-ordination.As my first step I want to import data.Can anyone help me to solve this issue,Thanks. ...

.NET Repeater HeaderTemplate

Hi all, Is there a way to access the field header name of a databound repeater within the header template. So insted of this.... <HeaderTemplate> <table > <th ></th> <th >Forename</th> <th >Surname<...

Setting focus onto another contol from button click

I am using ASP.NET 2.0 and VB.NET (C# code will also help me out) On top of my page I have a button called btnViewRecords. When the User click on the button I want to set focus to another button or label further down on the same page. How can this be done. This code does not work for me.............. btnTheRecords.Focus() or lblH...

How to manipulate a gridview in asp.net when the columns in the gridview are generated during runtime

Hi guys, In my application,i have a gridview in which columns are created at runtime.Actually these columns are created when i am entering data in a database table. My gridview is like this:- Description | Column1 | Column2 | Column3 | ...... |....... |......... Input volt | 55 | 56 | 553 |........ Output volt | 65...

How does the Visual studio populate the references tab?

How does the Visual studio populate the references tab? By using something like currentDomain.GetAssemblies() or what? ...