I have defined an interface named IEmployee (ID, FirstName and Surname properties) but I have not yet implemented that interface in any class. What I want to do is something like: Dim User as New IEmployee User.ID = 1 User.FirstName = "" User.Surname = "" Call SomeFunction (User) The VB.NET complier does not seem to like this.
Is there an fast/easy way to locate the object in question (using Visual Studio 2010 Express) when one gets the "Object reference not set to an instance of an object." error?
I know I can get an assembly via a type (e.g.: "System.Reflection.Assembly.GetAssembly(type)"), however, I would like to get an assembly some reference belongs to.
trying to get my hands wet on vs 2010 and i downloaded samples from ms site but when i tried to run some of the DB samples i received this sql error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) any ideas how to get around on this?
I'm creating an updater for an IP address, and I need to ensure that only one instance is running on the computer. This is to prevent (or at least make it more difficult for) having multiple tunnels running (it's an updater for an IPv6 tunnel).I've seen various ways of doing it in VB 6.0 and early .NET, but nothing that deals with .NET 3.5 or VIsual Basic 2010.
i am using "Animated Window Effects with "Toast" popup demo" code from the code bank created for jmcilhinney. I put a NotifyIcon control on it and check Make single instance application on the project properties windows. the problem is that every time that i launch the app it creates one instance on the system tray of the app. i can not figure out how to over come this attached is a copy of my project.
I am writing a program that makes use of SQL databases using MSSQL Express 2008. I've just written code that updates data in the DB, but I noticed when I update an entry in one instance of the program, and then try to update the same entry in a second instance of the program it goes through. What I want is concurrency so if the entry is different from the original, updating is not allowed.
Here is the code I use to update entries VB that calls the class and checks for errors... Try If contactIsValid() Then Dim getresults As New groupfilladd If getresults.updatecontact(myParent.itemfound + 1, fnameTxBx.Text, lnameTxBx.Text, _ [Code] .....
Suppose I have a class of objects called Porky with a property called IsHuge:
Public Class Porky Public Property IsHuge As Boolean End Class
Now I want to make a special kind of Porky -- let's call it UberPorky -- for which I want to change ALL instances to either IsHuge or not IsHuge. What I'd like to do is this:
Public Class UberPorky Inherits Porky Public Overrides Shared Property IsHuge As Boolean
[code]....
The trouble is, I can't do that. I'm not allowed to reference MyBase or Me in a Shared property.
When I attempt to add a Service-based Database in VS2010, when starting a new project in VS2010, I receive the following error immediately after clicking "Add" when the Service-based Database is selected.A network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or is not accesible. Verify that the instance name is correct and that SQL Server name is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified.)I've googled this problem and found this topic (url...), which wasn't able to help me. I'm still finding additional topics to troubleshoot with as well..
How can I get this interface programed into VB?Here's the interface:
USB data sent from the PC:
Byte 1: Scan Quiz, with value of 0x55 Byte 2: Number of bytes to receive, with value of 0x02. Byte 3: Mask, with value 0xFF to enable the first 8 quizzers. Byte 4: Mask, with value of 0xFE to enable the next 7 quizzers
So I need my program that will read some cells on excel and then dynamically create textboxes on the form to hold the cell data. Everything goes along swimmingly, until vb refuses to create new textboxes saying "new cannot be used on an inteface." I figure this is something to do with the Microsoft.Office.Interop.Excel... So how can I dynamically create new textboxes now?
The relevant lines of code Imports Microsoft.Office.Interop.Excel Dim newqlabel As New TextBox
I'm trying to create an array to be handled during my code. I want to create it as soon as I open the program so I've placed it in my bit of constructor code. This code was working fine before I tried to initialize a new array in there but when I place that in I get the above error message. This occurs whether I put the new array bit of code first in my constructor class or not.
I have two forms , say FormA and FormB..In FormA, a Button Click i wrote FormB.Show.When i click again the button its creating another instance of FormB.i want to make FormB as single instane, if again the button event raised i need to focus the FormB rather creating another instance.
I have following instance of System.Collections.Specialized.NameValueCollection:
Dim UserSelection As New System.Collections.Specialized.NameValueCollection UserSelection.Add("D_Color1", "Black") UserSelection.Add("D_Color2", "Green") UserSelection.Add("D_Color3", "Purple")
I need to save this instance to hard disk and then load it back from hard disk as an instance. How do I do that?
D is a dictionary whose entry values are of Type T..What I'm attempting to do is have a delegate like "Serializer" below that I can invoke on an instance of T, such as "Entry.Value" below.Please see the "return Entry..." line below for my wishful thinking.[code]
I am looking for a way to make my app running in a single instance mode and showing the MainWindow of the first instance when another instance is launched.I do a quick search on the internet but I did'nt find anything to open the MainWindow of the first instance or it was for Windows Form not for WPF.
I am using this: Dim oFile As System.IO.File Dim oWrite As System.IO.StreamWriter oWrite = oFile.CreateText("e: est.txt") oWrite.WriteLine("TEST") oWrite.Close() Which works, but I would like to have it so instead of creating test.txt it names the document using multiple input text instance.
I'm trying to obtain the values using the prospective GetValue(s) methods but I don't understand the syntax of the documentation. I'm sending the correct bindings (I believe) to filter the fields, and properties that i'm interested in usually
I have a single instance VB 2010 application I know how to communicate with the next instances run through the StartupNextInstance application event. The usual way of working with this is parsing command line arguments of the new instance and continue execution of the old instance. What I would like to do is replace the running instance with the new one. Is there any way to do this other than disabling the single instance property ?
I wish to have the main screen just like the Kaspersky main screen, in my applications. That is, I'm really impressed by those tabbed menus. I mean, the user will select the menu from left side and corresponding menus and details is shown in right (see the pic below). How can I do that ?
How do we automate the process of deriving an Interface from our already-designed class?In other words, I wrote in completion my entire class and now desire to automatically construct its interface. EG: Say my class's filename is "Car.vb", I now desire "ICar.vb" derived from the class "Car" that I've written.
creating a COM component Instance like this for supporting multiple version of COM components
Creating Instance Private _cmObjct As Object Public Property CreatingInstances() As Object Get
[code]....
at the same time how to declare this method without referenced dll SSDP is an interface so how to declare this interface for my usage is this Correct ...?
Error: Dim d as Object = Activator.CreateInstance(Type.GetTypeFromProgID("SecureTronics.SSDP"))
I am working on a sports management game and have already received some terrific help here with some XNA stuff. I now need some help for the user interface though. This game is very menu-centric, with loads of stats and tables and such. It is therefore paramount to get it right!
So far I have been doing all of the work on my 24" monitor at 1920x1080. Whilst the form is 1920x1080, the menu fits within a 1280x1024 top left region of the form. When I run the game on my other computer, which has a 19" monitor at 1280x1024, I was expecting a large chunk of the form to be cut off but the menu to be all visible. Well, it is all visible but things screw up. Different controls will overlap and such. I'm using Krypton Components for most of the UI and some of the text boxes seem to shrink vertically so you can only see less than half of the text. I have no idea why, they won't all do it.
I am loading forms into a TabControl creating a new tab page each time the form is loaded. ** I would like to point out that I am using UC instead of a from**
Now, I can easily have many tabs with the same form loaded. On the form I have a 'Search Button' So my question is, after clicking the search button how can I tell which instance of the form the 'Search Button' was clicked? Hope this makes sense
today I successfully configured an interface to work with a test database I created in MS Access 2003. The database consists of only 8 records with 10 fields.
I used the basic built-ins with VB 2010 to build the interface in a simple form which shows only 6 of the 10 fields. It all seems to work well, that is the connection string built correctly, and I can run the program and view the individual records. My trouble is that when it goes to the 1st record it's actually the 3rd record in the database. And when I go to the last record it's actually the 2nd record in the database and the next to the last record is actually the first record in the database.
why the program seems to start at the 3 record and shifts the first two records to the end. All the records show up, it's just that they are somewhat out of order.
Interfacing fingerprint to visual basic 2008 or 2010..using serial port...the use of fingerprint is for password only..actually my thesis concept is like electronic locker..
I'm trying to hone up on my (beginner) coding skills & I would prefer that the the 'Designer coding window', not the 'Design window', wouldn't interfere with these studies. Sometimes it's there & sometimes it's not. I don't understand it at this point & would prefer it wasn't there. All I need is the 'Design window' & the 'regular coding window'.
A while ago, I wrote a web-based guestbook application that wrote it's own database.
My code was very amateurish, but, as it was my very first publication, I was very happy with it. Only about a month after I'd published it did I realize I'd made a huge mistake in the code.
I've only ever connected to a specific named instance of SQL Server, and it occurred to me that, if the SQL Server instance has a different name than the one I specified, it wouldn't work.
So, since my users will probably not know what the name of the instance of SQL Server that's running is, I thought adding a field where the user can specify it would help if they do, but what if they don't? My answer was to get the local instance, regardless of name.
I tried Data Source=.local;, Data Source=.; and other variants, but nothing worked.