I've built a UserRepository interface to communicate with my LINQ to SQL Data layer, but I'm trying to figure out how to implement validation.
Here is what my AddUser subroutine looks like
Public Sub AddUser(ByVal about As String, ByVal birthdate As DateTime, ByVal openid As String, ByVal regionid As Integer, ByVal website As String) I...
hi guys,
I am trying to display my data in datagridview. I created a class with different property and used its list as the datasource. it worked fine. but I got confused how to do that in case we have nested class.
My Classes are as follows:
class Category
property UIN as integer
property Name as string
end class
class item
...
I have a DataGridView that is being filled with data from a table. Inside this table is a column called 'group' that has the ID of an individual group in another table.
What I would like to do, is when the DataGridView is filled, instead of showing the ID contained in 'group', I'd like it to display the name of the group. Is there some ...
What error handling should be used in VB.NET?
Should one use the "On Error Goto ErrorHandler ... Exit Sub ErrHandler ... End Sub" pattern or should you use the "try { ... } catch { ... } finally { ... }" pattern?
...
Consider the code:
On Error Goto ErrorHandler
Using sr As StreamReader = New StreamReader(OpenFile)
str = sr.ReadToEnd
sr.Close()
End Using
Exit Sub
ErrorHandler:
If there is an error inside the Using block how do you clean up the sr object?
The sr object is not in scope in ErrHandler so sr.Close() cannot be called. Does ...
Hi guys, I am new to VB.net and struggling to get out of VB6's way of sending data, I am doing this to send a byte array from my client to server, please advice if this is the right way, thanks:
The sending portion:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
...
I have searched a lot to find a solution for my problem, but I can't find any specific solution.
I need to change a value which is stored under HKEY_LOCAL_MACHINE\SOFTWARE\APP_NAME. It is not possible to use .NET's registry functions, since they have drastic restrictions.
The following snippet should solve my problem:
Dim regKey As Re...
VB.NET: Can the .EXE built by VS2005 be deployed as a standalone EXE?
When I change the mode in VS2005 to "Release" and build the solution, the bin\Release directory then contains the solution .EXE file, but also a .pdb, vshost.exe and .xml file. What are these extra files and are they necessary?
I copied the .exe file to another mach...
Hi all,
I'm using resources in VB.NET(2008) to manage my files and have 3 icon files that need to be on 3 buttons on my form (clicking the button changes the icon of the form tot the pressed button)
ICO_1.ico
ICO_2.ico
ICO_3.ico
but when I try the code below i get the error that "Value of type system.drawing.icon cannot be converte...
Hi All,
is it possible to use icon file as a image for a button in visual basic?
f.e.
I have 3 buttons that need to have 3 icons when you click the button the icon of the button needs to be the icon of the form is this posible?
btnIcon1 = my.resources.ICO1
btnIcon2 = my.resources.ICO2
...
I am trying to deploy an application that uses SMO on a workstation without SQL Server installed on it. The instance the app is connecting to is SQL Server 2008. The application is failing with:
Could not load file or assembly 'Microsoft.SqlServer.Replication, Version 10.0.0.0, Culture=neutral, PublicKeyToken=89845cdc8080cc91' or one ...
I'm using the following function to generate a list of users connected to a selected database. How would I change this to a single line for multiple identical results?
For example: "sa (3) - MYCOMPUTER" rather than listing "sa - MYCOMPUTER" three times?
Function ConnectedUsers(ByVal SelectedDatabase As String, ByVal SelectedInstance As ...
Hi guys,
I am running from a problem while iterating over class properties.
I have my first class:
class Item
private _UIN as integer = 0
private _Name as string = ""
private _Category as ItemCategory = new ItemCategory()
public Property UIN() as integer
public property Name() as string
public property Category() as ItemC...
Hello people,
i installed msmq on a windows mobile 6 device using the msmq cab from wm 5 server tools which provides the visadm utility and the required dlls for msmq. The msmq installed without any issues (installed -> registered -> soft reset -> enable binary -> enable srmp) The thing is when i run the app i developed (Vb .net , compa...
As said in the title the function page_prerendercomplete gets hit many times and I don't know why this may be.
Im running a large vb.net 4.0 web solution which uses ajax.
Just loading up a certain pages means it gets hit 3 times.
Also when hovering over a button which does a ajax called (using a update panel) it also gets hit once.
Ca...
The below code will fill User Records in "users".
Dim users= From p In oDbUser.USERs Where p.STATE= "MI" And p.STATUS = 1
Can anyone tell me how can i use a foreaach loop in the result and take each indidual row items ?
...
(1) I've read a lot of questions about IDisposable where the answers recommend not using Finalize unless you really need to because of the process time involved.
What I haven't seen is how much this cost is and how often it's paid. Every millisecond? second? hour, day etc.
(2) Also, it seems to me that Finalize is handy when its not alw...
Hello, I am new to ASP.net MVC and I am having trouble getting dropdown lists to work correctly.
I have a strongly typed view that is attempting to use a Html.DropDownListFor as follows:
<%=Html.DropDownListFor(Function(model) model.Arrdep, Model.ArrdepOptions)%>
I am populating the list with a property in my model as follows:
Publi...
I need a Generic function to retrieve the name or value of an enum based on the XmlEnumAttribute "Name" property of the enum. For example I have the following enum defined:
Public Enum Currency
<XmlEnum("00")> CDN = 1
<XmlEnum("01")> USA= 2
<XmlEnum("02")> EUR= 3
<XmlEnum("03")> JPN= 4
End Enum
The first Currency enum val...
i have a winsock component made with vb.net in a class library that has events.
how do i make it appear in tool box if i reference the dll in another project.?
How do i use it in my c# program?
thanks
...