Referencing An Int Value In VB?
Apr 25, 2010
I have a line of VB code which looks like this : If GroupTagDropDownList.SelectedValue Is "1" Then The system doesn't throw up any errors for it but the statement doesn't appear to work.
I think that the problem must lie in how I've referenced the '1' value - I've tried putting single quotation marks around it but it appears to make no difference at all.
There is definitely a value in the drop down list of value '1' but it doesn't appear to be read at all.
View 3 Replies
ADVERTISEMENT
Apr 24, 2012
I am a self-taught noob and have been given the task of developing someone elses code. I have rebuilt someone elses solution into my dev machine and able to run with some minimal bugs. I don't know where to add an .xls file into my solution
System.IO.FileNotFoundException was unhandled
FileName=TestRec.xls
Message=Could not find file 'TestRec.xls'.
[code].....
View 5 Replies
Sep 9, 2010
I have been given a .dll file (implemented in C++) that I want to use in my VB.NET application.When I try to add a reference to this dll using Visual Studio I get the following error:A reference to 'path-to-dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Based on this error I concluded that I need to register the dll. Since it has been implemented with unmanaged code I tried to use the regsvr32 tool to register it. But when I try to register the dll using this tool I get the following error:Name-Of-DLL was loaded, but the DllRegisterServer entry point was not found. This file cannot be registered. how do I add a reference to this dll in my VB.NET application?If I have to register it, how?
View 1 Replies
Aug 10, 2011
Imports System.Runtime.CompilerServices
Module StringExtensions
<Extension()>
Public Sub Print(ByVal aString As String)
[code].....
View 6 Replies
Sep 28, 2010
I need to reference a C++ dll from my Java project. The method that I need to expose is actually written in Visual Basic. Is there any way to access the Visual Basic code in C++, so that it can eventually be accessed in the Java project?
View 6 Replies
Dec 7, 2010
I have a java class that is used to for ssl connections to a web server. I have got some of it converted however there are serveral java libraries that i have been unable to figure out how to call or reference in vb.net. First off i'm not even sure if it's possible to reference them. In Java code they look like this:
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
[code].....
I'll use the last one for example: I get a "Namespace or type specified in the Imports 'org.xml.sax.SAXExeption' doesn't contain any public member or cannot be found. make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use aliases.
View 6 Replies
Jun 15, 2010
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 type of VB.net 'magic' that can do this, or do I need to cross-reference the data myself?
Here is a breakdown of what the 2 tables look like:
table1
id
group (this holds the value of column id in table 2)
weight
[code]....
BTW - I am using Visual Studio Express.
View 1 Replies
Apr 19, 2011
I've been poking around in some projects written by one of our contractors, and he seems to be storing a lot of settings in the main "app.config" file for the application, using, for example:
<add key="SomeClass/SomeValue" value="False"/>
And then referencing the key value in the "SomeClass" class in "SomeProjectLibrary" using
ConfigurationManager.AppSettings.Get("SomeClass/SomeValue")
While this works, I guess, it also pretty much sucks. I was wondering if anyone knew of some more elegant way of creating variables in the "app.config" file, which could then be used across various applications within a Solution?
View 1 Replies
Jun 11, 2012
I'm developing an app in which there's hundreds of different calculations involved and would like for my app's admins to be able to tweak these calculations by specifying the formulas.For example, my database table contains price and quantity. One of the columns 'X' might contain "(price * quantity) over the past 7 days". How can I allow my app's admins to change the calculation from "7 days" to "14 days"?
Is there some way to make calculations dynamic within VB.NET or do I have to rely on stored procedures and write some code to alter those procedure if a change is needed? What are the best practices in this type of a scenario?Ideally, I would like to use something similar to the "Tags" box used when posting questions on here to bring up the available fields and add mathematical operators in between them to perform calculations. It might be adding more complexity, but would be great if an existing calculation isn't overwritten so that it could be used in building a new formula.
View 2 Replies
Jun 30, 2011
I was directed to update an old VB6 dll to VB .net as we are moving away from COM objects. The dll contains one function that does a bunch of high math calculations. I opened up a new class project in VS 2005, Imported System.Math, and then basically copied the function code from the VB6 project into the new class. When compiling, I made the assemble COM-Visible and also checked the Register for COM Interop in the project properties. I then copied the dll and tlb files to Windows/system32 and tried to register using Regasm.exe.
Even though I'm using the correct version for .Net 2, I still get error RegAsm : error RA0000 : Failed to load 'C:WINDOWSsystem32eagetairmiles.dll' because it is not a valid .NET assembly. When attempting to add a reference to it in my new .Net project, I see it in the COM tab - but in the location it was developed in, and I receive the following error: Converting the type library to a .Net assembly failed. Type library mydllname was exported from a CLR assembly and cannot be re-imported as a CLR assembly.
View 3 Replies
Feb 20, 2009
how to create a class yet, and I think I need to learn how.I am wanting to shorten my code in a form, thinking of creating several classes to do so.Lets use a Listview as a reference if you dont mind.Say there is a listview, you have a numeral amount of if statments to fill by. Is there a way to create a class(is this the way to go) so that you can open the class to modify that specific block of code? Example of questionYou have multiple items you need to add for each if statement. Animal as a group Dog as an item 14 years as a sub item Cat as an item 11 years as a sub itemIs this the way to go, if so how do you create a class and call it from a form?Davids Learning
View 4 Replies
Mar 15, 2010
Ive have a listview on my form and need to populate it with data from my Table called "tblCustomers". However I need to only retrieve records based on field that is populated with data called "Joe". In order for the SQL syntax to retrieve the name "Joe" then the SQL syntax needs to reference the Label on the form called "lblName" which will have the name "Joe" as the caption.
How can my dataset have SQL data that references my label object on my form?
View 5 Replies
Jun 25, 2010
i have just installed Visual Studio 10 and DirectX SDK (June 2010), however i can't seem to add directX as a reference. I have also tried Direct X SDK (march 2009).
View 3 Replies
May 31, 2009
I am currently working on an application that is about 90% finished, and we just got an addition that requires us to create a new project in the solution. My question is, I have a bunch of classes created in the main project that deal with the database, and it has a lot of functionality that I could really use in this other project.
View 10 Replies
Nov 18, 2011
I am building application that will be hosted as a web service. This app takes an employeeID and returns an employee object that contains lots of info regarding the employee. (name, status, full-time/part-time, etc)I want the two existing apps we have (and more to come) to be able to call a method that the web service will have and return the employee object. (also at time this web service that returns the object may have new fields added to it - Pay rate, etc)How would I go about creating a new object from this web service reference in the existing applications.Would I decalre it like Dim Employee as new emp_webservice.employee? And then be able to use this object within the app? Or would the better practice be to also included the same class files? It seems like this would not be the way to go, since if I make a change to that class I then have to make it in all places.
View 1 Replies
Jan 9, 2011
I have compiled a C# class as a .dll named TileCalculations.dll Within the Class its namespace is TileCalculations and the Class is TileSystem
namespace TileCalculations
{
static class TileSystem
I have attempted to add this to a vb.net poject using Project > Add Reference and navigating to that file and selecting this dll. I see the dll in my Project Properties Window and the Local Copy property is set to True.
I have included the following:
Imports System.Net
Imports System.Diagnostics
Imports System.IO
[Code]....
How do I call the function MapSize. I am trying;
Dim intmyValue As Int32 = MapSize(17) ' should equal 33,554,432
I get a message 'MapSize' is not declared. It may be inaccessible due to its protection level.
View 1 Replies
Jun 26, 2011
MyProperty is just a property defined in another class. However when I try to reference that property as shown below I get an 'Identifier expected' error
This works:
TDTL.DataTopLevel(FileNumber).DataSet(FileDataSetNumber).MyProperty = TempVar
This does not work:
dim poo as string= "MyProperty"
TDTL.TireDataTopLevel(FileNumber).TireDataSet(FileDataSetNumber).(poo) = TempVar
View 3 Replies
Mar 1, 2010
This is a project I am working on written in Visual Basic, using Visual Studio 2005.I have a form (FrmMain) which contains a user control (CtrlDisplay). Within the user control (CtrlDisplay) is a list box which pulls information from a database. when you click on a button it checks another database to see if you have all the required components to build the object in the list box. If you dont have the parts, a dialog box (DiaAddToList) opens up to ask you if you would like to add the missing parts to your next order.
I had this all working perfectly when I was using forms and a MDI parent container. Now I am using a single form which swaps out user controls. the issue I am running in to is, the dialog box has the button "Add to next order", which is supposed to start routine to add the objects to the inventory. using forms, it was easy to do this, on DiaAddToList, under the sub when you click the add button, the code was FrmDisplay.AddList()
Now that I have switched it to user controls I tried to put CtrlDisplay.AddList(), and it is telling me "Reference to a non shared member requires an object reference". How do I reference the CtrlDisplay. It is already open and running on FrmMain. I tried to use "Imports.MyProject.CtrlDisplay" and that didnt work.
how I can reference this? It is starting to look like I will have to put the list boxes and routines into FrmMain, but that will end up with something like 200 boxes on one form, all overlapping and making it REAL confusing.
View 2 Replies
Mar 24, 2009
I am very new to VB and trying to understand Array's. I am having trouble referencing the contents of the Array in other areas of my application and I ma getting object Reference Errors and the contents of the Array appear as Nothing and I get a null reference error.
The Array is being loaded from the Sequel Server and I am adding two columns to the Array to add data. I am getting all of my Array in the Return Array, however I acm unable to reference contents of the Array and write out the contents. I need to reference the contents.
The Array is called MyArray, and I need to reference each part of the Array as MyArray(irow,1) for example.The irow will always vary but I will always have 10 columns. How can I reference the Array in other parts of the application? I tried dimensioning the array at the Class Level, but the array shows nothing in it.
My Code here works and the Array Returns with all of my data that I need all ten columns, but I can't reference the pieces of it elsewhere in the application in another button event in a Private Sub or Public Sub.
[Code]...
View 2 Replies
Jan 21, 2010
I've got a project folder which contains all my forms and another project folder where I keep my classes. The forms folder references the classes folder.I can reference the classes folder from the forms folder alright but I have problems when I try to reference a form from a class. For example, if I pass one of my form objects to a class, the class doesn't recognize its type.VB doesn't allow circular referencing so how can I get around this ?
View 3 Replies
Jul 12, 2011
I have 2 Forms in a VS 2010 Project. Form1 is the Startup Form and can, with intellisense see Form2, but NOT the Controls on Form2.
Form2 can with intellisnse, see Form1 AND the Controls on Form1.
Why can't Form1 see the Controls on Form2? I've not seen this issue before in VS or VB6.
The error message is :-
Reference to a non-shared member requires an object reference.
The Controls on Form2 have the Property of Friend.
View 2 Replies
Jul 12, 2011
In the beginning, I set a cookie value like this:Response.Cookies("UserInfo")("UserName") = "Bob"nd it was good.In the end, I need to read that cookie in javascript. But I have no idea how to do that. The documentation for javascript and cookies (especially those set like I have above) is poor at best. Most cookie-reading functions out there seem to only accept 1 argument (cookie name). But as we clearly see here, I have to pass two arguments to get the value for "Bob".
View 1 Replies
Sep 23, 2009
I have a project that references two DLL files in the system 32 directory as COM references. The files are certenroll.dll and certcli.dll which are included in the system32 directory as part of the OS. My app is a console application that I'd like to have as a standalone exe. It seems that the these files are converted to something like Interop.CERTENROLLLib.dll and Interop.CERTCLIENTLib.dll and dropped in the bin directory for my project. Since I want the app to be a standalone exe able to run on other PC's I'd rather see the app reference the original DLL files in the system32 directory and not have to carry these dependency files around with it.
View 2 Replies
Oct 12, 2010
I'm working on a short project and am stuck on a something small near the end. I am writing a program to input income and expense of a company and then output the profit or loss. We are required to use InputBox Functions for the income and expenses which I have already done with their own buttons and now I am trying to code a calculate button to calculate if they made a profit or loss and output that to the user. I am not getting any errors and I am getting the correct format ($0.00) but no output. I am also going to attach the entire solution for anyone that needs it and it will be zipped.
Private Sub incomeButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles incomeButton.Click
Const prompt1 As String = "Enter a income amount. Click Cancel to end."
Const title1 As String = "Income Entry"
Dim inputIncome As String = String.Empty
[code]....
View 4 Replies
Mar 12, 2011
within the SqlCeCommand framework of VB.net, I am looking for a simple coding example to return data from the last record of an SQL database. The purpose is to return the last sequential "counter" value from the primary key of the database, and then append additional records to the database, continuing the counter value from the last record. This counter value will of course vary with each update.
View 9 Replies
May 3, 2012
I have 2 forms in my project. Form1 does all the grunt work and Form2 is a setup form.
In a module I have placed this
Public myForm2 As New Form2
In Form1 I have this in a routine
For Y = 0 To myForm2.lstCallWatch.Items.Count - 1
The listbox has 12 items in it but the items count is ALWAYS 0
What am I doing wrong to read the number of items in the Listbox?
View 8 Replies
Mar 2, 2009
I have a VB.NET Windows application which uses Excel and Outlook, as I Know I have to reference either Microsoft Office 12.0 or 11.0 according to the office used (2003 or 2007). is there a way so that my project works on both and how can i do this?
View 11 Replies
Aug 31, 2011
Basically, within VB (Visual Studio Express 2010) one can input text files (from "Add windows Form ->Text file" ). The thing is, I can never reference the text within them using the techniques that I know (which are limited, but anyway). It's quite annoying, to say the least. I can quite easily reference files outwith VB but I am experimenting with these, and its annoying that I can't do it...
How might I reference them?
View 5 Replies
Mar 14, 2009
I made a browser and its awesome but i want to reference the browser name so that i can add script to it, I am calling the new browser window "wb" cause that's what it gets named in the script. here is my code. (it labels the tab, the window, and changes the URL text field)
Private Sub wb_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles wb.Navigated
TextBox1.Text = wb.Url.ToString()
Me.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle & " - My Browser"
[code]....
It says "Browse.Name = "wb"" so thats why im trying to call it "wb". I inserted a WebBrowser on the form named wb and then tried to run it and it worked, it labeled the window, tab, and changed the URL field. So i know that the script works. Please help me, I know you guys can solve this, I'm really new at this.So my final question is... What should I call the browser instead of "wb" when I am referring to it in the first script I posted above? I am so confused. How do you refer to an object that gets created dynamically?
View 3 Replies
Jan 11, 2012
I'm just trying to reference report objects (specifically textboxes).For example, let's say from a form, the person has to enter a specific title each time the report is run; or they have to enter something that has to appear along side each record in the detail (List) of the report each time it's run.
How to you pull the info on a form into a report? Is this even possible in VB? (it was quite easy in Access)I've tried in the Form code something like: My.Forms.Form3.ReportViewer1.textbox1.text = My.Forms.Form2.TextBox2.TextBut of course it says "textbox1 is not a member of Microsoft.Reporting.WinForms.ReportViewer" Then I've tried adding an Expression to a textbox in the report itself in an attempt to try and pull the data from a form. The Expression for a Report textbox went something like =My.Forms.Form2.TextBox2.Text
View 2 Replies