vb.net

Insert a null Value into a smalldatetime column in SQL using LINQtoSQL via VB?

I have a smalldatetime column in SQL that can have a null value, but when I try to insert a null value using SqlTypes.SqlDateTime.Null and LINQtoSQL it puts in 1/1/1900 instead of NULL. What is the best method to insert a null, or am I doing it at the moment. If I am using the correct method at the moment, what should be done to prevent...

How do I validate a textbox to only contain numbers?

If the user enters non-numeric and numeric values in a textbox, how do I keep only the numeric part? ...

Store state of my checkbox list

How to store the state of my check box list tick boxes accross the page life cycle? Here i have a unbound checkbox list control where values comes from xml file. how to retain the state? Moreover, when i click on Next button to the new page and comeback state is retained. But when i click on the back button and come to the same page ...

Check for SSL and forward to it

This is simular to this question: But I want to do it within the MVC where the "Request" object isn't directly accessable. Is there a method decorator to specify actions that require SSL? How do I get the equivalent of the answer in the mentioned answer within the MVC? If Not Request.IsLocal AndAlso Not Request.IsSecureConnection The...

Binding key combinations to your application

How can I bind a key combination to my vb.net application? I know it has SOMETHING to do with the registry, but I have no earthly idea what or how to go about doing this. I want the user to be able to hit those keys when the app is open and have it execute my function, but not while the app is closed. Thanks for the help! ...

Adding an item to the system context menu

How do you add an item to the system context menu? I would like to let my users be able to right click anywhere and launch this program. I cannot seem to find it documented anywhere either. Thanks for your help! I am coding in vb.net ...

What is this pattern called?

Private someSub() If someBoolean = True Then Exit Sub ' do some great work because someBoolean is False End Sub I know there is a name for this. The idea is to check something and if it isn't what you want then you stop code processing. I thought it was called "escape pattern", but Google isn't confirming that name. ...

Create ASP.net 3.5 web form application derived from Excel Workbook

Good Afternoon, A customer has provided me with a spreadsheet file his team uses to provide quotes for a product. The spreadsheet has extensive data in underlying sheets and calls those sheets as part of the numerous formulas on the quote sheet. I've been tasked with web-enabling this tool such that the quotes can be generated on the ...

SharpDevelop - mixing C# and VB.NET in one project possible?

Is is possible to mix C# and VB.NET files in one project when using SharpDevelop? ...

Can I retrieve the provider if I have a connection object?

Given a connection object (or series of them), does anyone know of a way to backtrack and get the provider name? I'm trying to create a generic dataset generator that someone could load up with n DbCommand instances populate the dataset without requiring any further information. Theoretically, as a command requires a connection object,...

Error handling using events, checking if an error happened and react accordingly

I have an object, say Order where if an error occurs, it raises the ErrorOccurred event. If I'm running some code in say, the codebehind for a .aspx page with an public Order registered as WithEvents and I want to check to see if an error has occurred before I run more code, how do I do this? I can't simply check theOrder.ErrorOccurred. ...

medical software - should i write my own or use existing?

i know nothing about medical records but im sure there's great opportunity in it now. im planning to either find software that manages records or build my own. if i do build my own, can someone recommend a platform to use? i prefer vb.net. is there anything better for this? if you do not recommend me to build my own medical records k...

How to store and retrieve images in sql server database through VB.NET

SQL Server supports the ability for clients to store objects within tables. Create Field that data type Image and Initialize byte array with a null value initially.Use FileInfo object to get file size.Open FileStream to read file.Use ...

SubSonic3: Method "FirstOrDefault" throws exception with SQL Server 2000

I am using SubSonic3 with SQL Server 2000. I have problem with the method "FirstOrDefault" - it always throws an exception = "Line 1: Incorrect syntax near '('." from the SubSonic.Linq dll EDIT (Added code from comment): InventoryDAL = DAL project name (dll) Inventort= Subsonic3 Gnerated classes Name space WHWarehouses = gnerated ob...

getting image from a picturebox

how can i get an image that i drawn on a picturebox? in my application i created a form with the freehand drawing.but i can't save the image that i drawn as a file,there have a error message that "object reference not set to an instance of an object".I am using the code me.picturebox1.image.save(filename,sysytem.....jpeg) any one know...

Sql Server Filestream access denied

I have trouble accessing filestream via SqlFileStream. Sql server and IIS7 are on different servers, remote access to Filestream is enabled. Workgroup for both servers is the same. I've tried everything, including opening user with identical username/passwords on both servers. Didn't work. Dim sqlFileStream As New SqlTypes.SqlFileStre...

picturebox image

myPictureBox.Image = New Bitmap(myPictureBox.ClientSize.Width, _ myPictureBox.ClientSize.Height) and Using g As Graphics = Graphics.FromImage(myPictureBox.Image) ' do the drawing ' End Using thanks for your answer. But please tell me where can i place this code. ...

multi threading a web application

I know there are many cases when it's best to multi thread an application but when is it best to multi thread a .net web Application? ...

picture's backgroundcolor in picturebox

how can i change the background color of a picture saving from a picturebox in vb.net.In my form there is a drawing section.after drawing i am saving the picture as jpeg.but the image's background color is black.so i can't see anything that i have drawn.the drawing pen color is also black.if anyone knows please help me.thank you. ...

Adding the CANONICAL tag to my page for SEO through code behind?

I am using ASP.NET with MasterPages. Thus i cant just place this link in my pages that reference my MasterPage. <link rel="canonical" href="http://www.erate.co.za/" /> I need to place this link in though my Page Load of each one of my pages. How would i do this through code? I am using VB.NET but C# will also help me in the right dire...