Im having problems passing values from my class "client" to display on my main form in text boxes. Im looking up a user input number and then pulling the clients first name, last name, and phone number from a text file. I figured out how to pull the information from the text files, but now im having difficulty passing the values to display in a another forms text box. This is what I have so far.[code]....
I would like an overview of System.EventArgs. I have an understanding of System.Object where I can pass data between subroutines and functions using Public Classes. I am curious what EventArgs do?
This is more of a conceptual question than anything.
I have a base class called "RawReader".
It sets up the framework for classes to inherit it and read in specific data systems.
For example, I want an app read in a known format of FoxPro database, a CSV file, or a SQL database (there is about 8 more formats currently), then transfer it over a webservice and create a SQL database from it.
I have everything working with CSV, FoxPro, Access, Excel, etc... Easy enough.
The classes that inherit RawReader, like RawCSV, RawFoxPro, RawAccess all return a struct that contains a dataset as one of the members. The dataset contains the data from the raw system. The webservice receives this struct and creates sql tables and loads the data into it. This has already been coded and works great.
My issue now comes to reading in SQL. Obviously, I could follow the same path, read the remote SQL DB into a dataset, transfer the dataset as above, etc... My "issue" comes in where I feel like it doesnt make much sense to transfer a SQL db to a dataset, transfer it through the webservice, and then try to programmatically recreate the SQL database. I feel like I lose a lot of the granular details from the SQL database (field sizes, extended info, etc..) It seems easier in practice to just create a backup of the database, convert it to a stream object and transfer the backup over to the webservice. But this is where the problem lies...
Since all of the classes inherit from the base class, they are set up to return a DataSet. The hack-ish way would be to just add a stream object to the return struct and in my webservice add other code to make a special case for SQL sources, but I was trying to avoid that.
Any thoughts on the "proper" way to go about something like this?
I'm still learning so this might be completely wrong. I have built a multi-user web application for internal purposes. I have split my code up to make it more manageable and have run into some problems. I suspect that I have done something very silly!
I have a class in a separate file (quoteStatus.vb) in App_Code here it is:
Imports Microsoft.VisualBasic Imports System.Data.SqlClient Imports System.Data Public Class quoteStatusHelper
[Code]...
This seems really wrong, as the value seems to be held in the partial class after the first run. So if I have two users accessing the class the public shared dim is changed for both users! There must be a better way to do this. I have looked everywhere and I'm more confused now than when I started off..How can I make QuoteStatus in the partial class unique to every user and access it from my code.
Im having a hard time trying to pass the values from a list inside of a class. Im trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value(num) counting each transaction that it adds to the list.
Code: Public Class Client Private m_tranlist As New List(Of transaction)[code]....
im trying to display each line that is stored in the list in a label, and im having major trouble. I know all of the results are added into the lists, but how do i call the list in my main form in order to display each line of all of the values? Would I have to look up an index or something?
Sorry if this is a bit random, but is it good practice to give all fields of a class a value when the class is instanciated? I'm just wondering if its better practice to have a constuctor that takes no parameters and gives all the fields default values, or whether fields that have values should be assigned and others left alone until required?
I am in the process of creating a program that needs to pass some information to another program. The program that needs to receive the data is meant as an update program to the first. I send a new copy of the host program over the sockets connection, then I need to pass the file name and location to the update program. After this information is sent the host program will quit so that the update can overwrite the host with the new version. The the update program restarts the host and everything goes on like normal. I have everything all-ready in place, except for passing the file information. I could just save the information in a text file and read form this, but it seems messy and illogical.
I have figured out, or think to have figured out, that the new way of doing arcs and lines does not require the HDC, so that problem is solved. The problem I am having now is that with the new way, every example I have found created a sub that does the drawings, like:
Public Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint Dim radius As Integer = 20 Dim diameter As Integer = radius * 2
[code]....
Is there anyway to pass values to this sub? I have to draw several arcs and lines and the values for them are different everytime. I would like to create a sub that would be used in every spot the old program used the old arc command and pass the needed values through it.
Dim oMyObject As New MyObject oMyObject.DoSomething("Parameter1","Parameter2")
The "DoSomething" and the two parameters are dynamically provided from another script. They are stored in a string object in this script: sAction & sParameters. My question is how can I dynamically pass the "sAction" to the object oMyObject.For example oMyObject.sAction (where sAction should be the value stored in the sAction string). The example will probably not work. Is there a way to do this? The idea behind is to avoid having to write each function hardcoded, like:
If sAction = "DoSomething" then oMyObject.DoSomething(sParameters) ElseIf sAction = "AnotherThing" then
I have 2 textboxes on form1 that I want to pass to 2 labels on form2, I used the Get Property to do this but i am getting errors, can anybody show me how to do this, I am new to visual basic
I thought make this would make my ada.myString have "working!" on the main appdomain, but it doesn't. I thought that by inhering from MarshalByRefObject any changes made on the 2nd appdomain would reflect also in the original one(I thought this would be just a proxy to the real object on the main appdomain!)?
now the form customer master has values within a listview. when i doubleclick on a value within the listview i want this form to close and pass the value to a textbox within the parent form. what would the code be? I am relatively new to vb.
I am using visual basic 2008. i have a listview and a datagridview which have both 3 columns like ProductCode,ProductName & ProductPrice. Now i want to pass listview values to datagridview in the same sequence. I want that when i double click on any row in the listview these row values inserted to Datagirdview.
I need to pass all rows at once created in a gridview to another. With the following script i can only pass one line at a time when i click the button.
Private Sub btn_add_equip_ext_guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_add_equip_ext_guardar.Click Dim rowext As Integer = win_Comp_orc.grd_NoOrc_Exterior.Rows.Count
I have a function that creates a button and textbox on my form dynamically. That all works fine, but now I need to pass values to my click event.[code]...
I am having a hard time trying to pass the values from a list inside of a class. I am trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value (num) counting each transaction that it adds to the list.
Ex: Public Class Client Private m_tranlist As New List(Of transaction) If CInt(tid) = m_ID Then 'create client tran, add to list nextTran = New transaction(m_ID, tcode, tdate, ttype, tshares, tprice, value, num) m_tranlist.Add(nextTran) num += 1 End If
Now I am trying to display each line that is stored in the list in a label, and I am having major trouble. How do I call the list in my main form in order to display all of the values?
i used a split container, in the 1st panel, i put the textbox for the user to input the values. In the 2nd panel, i put the datagridview to output the values that the user inputted. Now, i don't know and i cannot find way how to print the values into the datagridview from the textbox.
Having a bit of trouble using the List.Find with a custom predicate i have a function that does this
[code]...
by doing it this way means i have to have a shared "currentKey" object in the class, and i know there has to be a way to pass in the values i'm interested in of CurrentKey (namely, keyname, and oldkey) ideally i'd like to call it by something like keys.Find(AddressOf FindByOldKeyAndName(Name,OldVal))however when i do this i get compiler errors.How do i call this method and pass in the values?
I am new using Vb. I did create an app that accept general customers info, and save it into a database using the bindingsource component(I don't know how to do it with SQL from VB). Everything was fine, but adding a couple of maskedtextbox has become difficult. I don't know how to pass the value of this fields to the database. I used the following code: phonetextbox.text = maskedtextbox.text Leaving the original fields in the form, I see the values on them, but they never goes to the database. Is this just possible using sql command from VB?
Rather using a DatagridView Column ComboBox i need in this phase of my project, to use a listbox outside the datagridview ,o pass values from listbox to the datagridview. I do not want these Values to be default in that, column of DGV but when adding new rows i want to pass different values,always form listbox to the DGV..