I'm not sure why you want to pull the entire months of tables data. I suspect that the data set will take some time to fill. You could try a paramtized query. Only fill the dataset withthe requested row. The difference is you would add "Where RecID = ? ". Your form would then have a text box for the user to enter an ID and a button to retrieve the data. Is this something that you could use?
Randy S
Posts
-
fastest way to copy a table to a new table -
Calculation errorsThe problem is that I am pulling data from Microsoft Access. No matter what data type I use in Access I can only place that data in a Single data type within VB. I used a little cheatiing by multiplying the return value by 100 and then transfering to a double and then deviding by 100. This if fine if the data in Access is currency but other data would just have to only be transfered to a VB single data type.
-
Calculation errorsIs something wrong or is this OK. If I add two variables with a data type of single and like (845.12 + 312.14) and sent this directly to a text property of a label the display shows 1157.26. But if I store the sum into a variable with a data type of Double then display, it shows 1157.26000976563. Am I not allowed to convert a single to a double?
-
SerializingI would just save toa text file. Then you could read from the file to restore the valus. It is easy. You need System.io an duse stream reader and stream writer. I have a logon form which is check for a saved user name from a file at load. And on Enter I save the user name to this same file. That way the user name is remembered when the program is ended and then restarted. Ex. ( sName4User is global variable, Private Sub frmLogon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' This will retreive a user name from file if present. ' Opens a file stream for reading Dim myFS As New FileStream("c:\winnt\Temp\User.txt", FileMode.OpenOrCreate, FileAccess.Read, FileShare.None) Dim myReader As New StreamReader(myFS) ' Assigning a reader sName4User = myReader.ReadLine 'Retreives username If Not sName4User Is Nothing Then txtName.Text = sName4User End If myReader.Close() End Sub Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click 'Storing username to file and closing if a username was entered If txtName.Text <> "" Then sName4User = txtName.Text ' Opens a file stream for reading Dim myFS As New FileStream("C:\winnt\Temp\User.txt", FileMode.OpenOrCreate) Dim myWriter As New StreamWriter(myFS) ' Assinging a reader myWriter.WriteLine(sName4User) ' Storing to the file myWriter.Close() Me.DialogResult = DialogResult.OK Else txtName.Text = "Enter a user name" txtName.Focus() txtName.SelectAll() End If End Sub
-
Automating movement of files from Within Windows console app to ftp SiteI've been meaning to reply sooner but I've had a battle with my web server. and I haven't won yet. I have a copy of the class I used for the FTP transfer. It will need some modifications but it may be a start for you. You can find it at ftp://4.10.187.76/FTP download class/clsFTP.vb just do a copy of the text and past into an empty class file. There are many notes in the file.
-
Automating movement of files from Within Windows console app to ftp SiteI did somthing like this. I have a error message saved to a file in .TXT then that file is sent to a FTP server. Most of the work is done in a class which is called after the file is created in a temp folder on the C: drive. Is this something like what you are looking for?
-
Send and receive file on VB.NETYou can send files to and from a share in your network if you only need to stay within an intranet. I've done this with system.IO. Is this what you're refering to?
-
creating a Form Having Return ValueTry this 1st dim your second form from your main form. 2nd In the second form user will enter data into any object (text rdo...) 3rd exiting the form will be "me.hide". 4th control is then back to the main form at which point you can read the values that are in the objects of the second form. ex; Dim findEntry As New frmSearch findEntry.ShowDialog() 'Form is shown. Used to set variables for search If findEntry.DialogResult <> DialogResult.Abort Then ' Do search when true, = Abort when cancel btn clicked sSearchText = findEntry.txtSearchText.Text sSearchItem = CStr(findEntry.cboItems.SelectedItem) findEntry.Close() sSearch is a variable which is assigned the value from the second form. Last step is to close the second form.
-
Binding ObjectsI simulated what you said you did and I get an error for partRecords that says "Declaration expected" on the mouse over tip for partRecords, which has the curvy blue line under it. Is that what you got? If so you need to put that code in a sub. It would most likely go in the form loading sub. To create this sub you can double click the form while in [Design] view. If I'm underestimating your intellegence I don't mean to. I just don't know how much VB you know.
-
Binding ObjectsI have put together a sample which may help. You can download this from my FTP server. You can access by IP address which will change in time so don't wait too long to download. The files are in a folder called "RandysBoundControls Two Tables". It is about 1.7meg. This is a project I did for school. It should be fully functional. The database is in Access and is stored in the Bin folder. If you recreate the dataset, a .vb file will be rewritten and the lines of code I put there for setting a default value will no longer be there. This will cause an error when you add. Default values are needed for Dates(Date Time Picker) and check boxes (more notes are in the project). I suggest you make a copy. You can program bindings but I did the binding at design time. Look at the DataBindings section of properties for the text boxes. There is a text property there for binding textboxes. The file is at FTP://4.10.187.76
-
Binding ObjectsUse the .fill method of the dataAdapter at load time. Just follow this syntax, 'daInventory.Fill(dsInv1)' You may need to include the table name if there is more then one for your dataset. When your objects on the form are linked you will want to use a Binding ManagerBase to navigate. Then you will use the .Position to change the displayed values. This is all easier if you have some sample code. Is any of this familiar or is all this new? Would you like a code sample?