vb.net

Correct error-handling practices for the data-layer.

What are good things to check for, with respect to error-handling, when you are dealing with the data-access-layer? For example, let's assume I have this function.. Public Function UserExists(ByVal userName As String) As DataTable Dim dt As Object = Nothing Dim arSqlParameters(0) As SqlParameter arSqlParamet...

Can Anyone Help me with this? Refresh update panel partially onclient side

i have a dynamically created gridview button that fires off a modal popup when clicked. I do this onclientside like so: function openModal(btnId, v) { deptdata(v); // __doPostBack('<%=DropDownList1.ClientID %>', ''); btn = document.getElementById(btnId); btn.click(); } function deptdata(v) { document.getElementById('<%=ve...

Using LINQ with express version of visual studio

Is it possible to use LINQ in the express version of visual studio? I am planning on refactoring my project to use LINQ, but I am the only person in my group that has a copy of visual studio pro. Will that cause any problems if someone using the express version has to modified my code? Edit I realize that the graphical tools are not ava...

VB and IGrouping for LINQ query help

I am converting a c# LINQ example: var query = from m in typeof(string).GetMethods() where m.IsStatic == true orderby m.Name group m by m.Name into g orderby g.Count() select new { name = g.Key, overloads = g.Count() }; In the a...

ASP.NET: Multiple assembly versions, same web application

Hello, Hopefully you ASP.NET pros out there can answer this question. I have a single web application that contains a website and a web service - both have several assembly references in common (data access layer, utilities, etc) - however, recent changes made to the web service will require different versions of the common assemblies,...

How to change font size without creating a new font

Is it possible to change the size of a font in .net winforms without having to create a new Font with the new size? ...

Problems Retrieving the Oracle TimeStamp Field in .Net

I need to begin working with milliseconds in .Net 3.0. The data will be returned from an Oracle Database and if I understand correctly Oracle can only store dates that use milliseconds as a TimeStamp. It does appears that the Date type in .Net can handle milliseconds but when I have tried to retrieve Timestamps from Oracle stored proc...

scale object size viewport-> preview

Hi. I toying with a project where I can position objects runtime on the screen. I also have an small "preview"-window, where I want to see the outline of the objects. I have an object array who have size and location on the "scene". Now I want to loop through my scene-objects and create one picturebox in the preview-window for each obj...

Linq Select Certain Properties Into Another Object?

So say I have a collection of Bloops Class Bloop Public FirstName Public LastName Public Address Public Number Public OtherStuff End Class Then I have a class of Razzies Class Razzie Public FirstName Public LastName End Class Is it possible using Linq to select the FirstName and LastName out of all the Bloops in the c...

How can I tell if a Balloon tip in the system tray has closed?

I have an application that uses a NotifyIcon in the tray to hide/restore the application, as well as pop up notices to the user of application events. My application has a notification queue, and I use the NotificationIcon.BalloonTipClosed event to determine when to reset the balloon and show the next notification (if there's one in the ...

Bindable LINQ (BLinq) in VB.NET

I cannot get Bindable LINQ to work with VB.NET for the life of me. How do I get the .AsBindable extention to appear? Sample code: Class TestList : Inherits Bindable.Linq.Collection.BindableCollection(Of TestItem) 'Some Helpers and stuff' End Class Class TestItem 'Some Properties' End Class Imagine I magically come up with a coll...

Parsing strangely formatted files

I need to parse a file but the data is in a strange format that I'm not familar parsing. The data is always formatted like this. The field name is to the left and the data is right of the "=" and all fields are always in this order. File Data: Report 1 of 1 job_name = JOBNAME job_no = JOB99999 job_id = 6750 rprt_id = 27811 rprt_name ...

Is there a good way to detect empty results in a Linq-To-Entities query?

The only way I know of is awkward: 'check for empty return Dim count As Integer = (From s In myEntity.employee Where employeeID = myEmployeeIDVariable).Count 'If there is a record, then process If count > 0 Then Dim r = (From s In myEntity.employee Where employeeID = myEmployeeIDVariable).First() . . . do stuff . . . End If ...

Working with the ObjectQuery Single Enumeration Challenge in Linq-To-Entities Entity SQL

I'm working on modifying this example: Using advWorksContext As New AdventureWorksEntities ' Call the constructor that takes a command string and ObjectContext. Dim productQuery1 As New ObjectQuery(Of Product)("Product", advWorksContext) Dim result As Product For Each result In productQuery1 Console.WriteLine("P...

Reason for Sorting a Hash Table

I was asked by an employer to sort a hash table. I always thought that the usage of a hash table was in a way non-sort friendly. Am I wrong in thinking this, and if not can you point me to a good VB.Net(Yes Kill me now, but it's an old system) method of sorting a hash table. Thanks. ...

populate a html list control using .NET

Hi I have a list defined like so: <ul id="myList" class='myClass'> <li class="myItemClass">Item 1</li> <li class="myItemClass">Item 2</li> </ul> using .NET how can I add items to the list dynamically? I also need to specify the class name on each new item ...

Weird strange things happening in repository record!

SubSonic 2.2. I use the repository record pattern, with a table "appointment" with an appointmentId as auto-incrementing int. I am trying to update it, but when I do update the fields with something totally different, dirty columns are always zero, and I get an exception. System.NullReferenceException: Object reference not set to an in...

Generating MHTML from HTML

I'm looking for a way of generating mhtml from a page in my asp.net web app. I've seen this website and played with the code but i don't really want to use interop.cdo and interop.adodb. http://www.codeproject.com/KB/aspnet/aspnethtml2mht.aspx Other than generating all the mhtml myself i'm a bit stumped.... Anyone got any clever ideas?...

Convert a date and time into a MS SQL select query using SelectParameters

Hi all, I have this situation where I have a SqlDatasource control and the select query is like: SELECT col1, col2 FROM table1 WHERE colDate = @date The source of @date is a label with the text: 2009-05-29 12:06:00 I get the following error when I run the query: Conversion failed when converting date and/or time from character ...

Project Eulers problem 16 in visual basic. Sum of digits in the number 2^1000

Project Euler's problem 16: 2^(15) = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^(1000)? I have been trying to do this problem for a few days now and i just can't figure out how to get vb.net 2008 to recognize anywhere near that large a number. I have seen in other posts that...