vb.net

How to limit CPU usage in a while loop

How do you limit the CPU of a while loop? In this case, the code which is inside the while loop: Private Sub wait(ByVal time) Dim sw As New Stopwatch sw.Start() Do While sw.ElapsedMilliseconds < time And StillOpen = True Application.DoEvents() Loop sw.Stop() End Sub But now, her...

itextsharp: how do i position a table?

I have created a simple table and i need to position. does anyone have experience with tables in itextsharp? here's my code Private Sub generate_PDF() Directory.SetCurrentDirectory("C:\Users\alexluvsdanielle\Desktop\") Console.WriteLine("Chapter 6 example 1: Adding a Wmf, Gif, Jpeg and Png-file using urls") Dim document ...

Debug.WriteLine not working

In the past, perhaps versions of Visual Studio prior to the 2008 that I am using now, I would do something like this in my VB.NET code: System.Diagnostics.Debug.WriteLine("Message") ..and the output would go to the output window. Now it doesn't. Something must first apparently be enabled. If this involves "attaching a debugger", pl...

Rendering strongly typed partial views

Setup: ASP .NET MVC 1 The Problem: When ASP .NET hits the RenderPartial("Openings"...) line, an exception is thrown ("Could not load type 'System.Web.Mvc.ViewUserControl(of IEnumerable(of OpenSpace))'.") even though the view exists and the proper model is being passed in. The views are all inside the View folder and in this case, they'...

Adding custom roles - VB 2008 Winforms

Hello Everyone: I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access. Application Layout: I have a Main form that opens a login form when certain actions occur. The Login form intern uses an authentication class that I've created, to authenticate users and set access rights. On my...

MS Word Office Automation - Filling Text Form Fields And Check Box Form Fields And Mail Merge

Does anyone have any good advice or experience on how to create an engine using C# (VB.NET is okay too) that is generic enough to handle most cases of MS Word text fields I need to fill with data I'm getting from a database? In short, I'm about to embark on this little Office automation excursion and I'm hoping a little bit of feedback ...

Problem in excel report generation

I am working on an Excel report and I would like the top rows to be empty to allow for an image to be inserted. However, I do not want the image size to change the width of the columns and would rather the data below do that. This is what I have so far: If ComDset.Tables(0).Rows.Count > 0 Then Try With Excel ...

Excel Report generation

Hi How can I set the column width and leave the top 10 rows empty in order to insert an image into my Excel report? Here is my code: If ComDset.Tables(0).Rows.Count > 0 Then Try With Excel .SheetsInNewWorkbook = 1 .Workbooks.Add() .Worksheets(1).Select() Dim i As Integer = 1...

Restarting windows service from website

I've a website that puts info into a mySQL database and a windows service (written in VB.Net) that polls the db and actions what's in there. However, occasionally it stalls and rather than having to RDP into the server, I want superusers to click on a button to restart the service. I can get the button to say, do a directory listing of c...

SubSonic3 VB.Net Add,Update, FirstOrDefault Problems

Hi, I hade build sctive record dal with subsonic3 Vb.net templates. and i am dealing with alot of bugs in the sub sonic dlls. 1)in Add() function: (i have fix) when indx has counter in the db the returnd new key type is decimal the active record fil have an exception "Public member 'Change Type To' n type 'Decimal' not found". i manage...

How to get the current startup project's physical location in VB.NET or C#?

I want the location of the current execution project i.e in VB.NET/C# or the current class file's path? Ok,let me elaborate i got 2 projects in one solution file,lets say A,B are projects, my startup project is B ,and im accessing a class file in A ,now i need to know virtual path of B. because i need it for accessing the resource file ...

How can I send parameters to VB.NET method from JavaScript code?

I have vb.net method and i call it from JS code i can't send parameter to this method and here is sample: JS Code : function OnSave() { var sign = document.FORM1.SigPlus1.Signature(); <%Save(sign) %> } VB method : Public Sub Save(ByVal obj As Object) Dim obj1 As New PFSIGNATURELib.SigniShellSignature ...

Using Statement with more than one system resource

I have used the "using" statement in both C# and VB. I agree with all the critics regarding nesting using statements (C# seems well done, VB not so much) So with that in mind I was interested in improving my VB using statements by "using" more than one system resource within the same block: Example: Using objBitmap as New Bitmap(100,...

itextsharp: pdfptable.writeselectedrows vb.net

can someone please show me documentation on this method? i have the following line: datatable.WriteSelectedRows(0, -1, document.LeftMargin, document.TopMargin, writer.DirectContent) and it doesnt seem to matter whether its topmargin or bottommargin, it puts it at the bottom of the page. ...

itextsharp using pdfptable as a 2x2 matrix

how do i use pdfptable as a real table (A x B) instead of just (A x A) declaring it this way gives me just one row: Dim datatable As PdfPTable = New PdfPTable(4) how can i declare it so that it has multiple rows and multiple columns? ...

Connection string for Ms Access Database

My Ms-Access .mdb file is on my website. It is in the App_Data Folder The current connection string is: OleDbDataAdapter Da = new OleDbDataAdapter("Select * from SerialNo", new OleDbConnection(@"provider=microsoft.jet.oledb.4.0; data source=ftp://ftp.WebsiteName.com/App_Data/SerialNo.mdb")); Where am I making ...

itextsharp: changing font size of pdfptable

how do i set the font for a pdfptable? ...

Looking for open source code/utility for maintain calendar in SQL Server DB

I am looking for some (preferable vb.net) code to use in an asp.net application that will allow me/my users to setup calendars (that I store in SQL server db). I am looking for something that will make it easy to schedule recurring appts (i.e. every monday, every other week on thursday at 9AM, every month,1st and 3rd tuesday, every year...

how do I clean up after a StreamWriter during an exception?

I'm trying to clean-up after an exception, and I'm not sure how to handle a StreamWriter. Dim sw As StreamWriter Try ''// stuff happens somethingBad1() ''//Sometimes throws an exception sw = New StreamWriter(File.Open("c:\tmp.txt", FileMode.Create)) ''// stuff happens somethingBad2() ''//Also sometimes throws a...

itextsharp: getting position of pdfptable

in my document i am creating 3-4 pdfptables. at design time i dont know the size of the tables. i need to place the 2nd table right after the first, but i dont know the position of the first (i cant calculate it because i dont know how big it is). how do i know where to place the second table? ...