i've been doing some research on serialization and it seems to me that this is by far the way to go, not only are you left to concentrate on the application logic rather than on how to store your data, but reduces the cost and is capable of handling the most complex of objects, some would argue that the reason for writing to a database is the querying functionality which would be difficult if serializing the class to xml file or an xml file stored to a database, however querying the specific datbase column is the same as querying for an indexed field or a tag within an xml file i would think (its the same idea here), on top of that when you change your class object you dont have to change the way it is serialized, this is automatic, some would say yes but you can;t load previous versions of the data, but this isn't true(it can be coded for) and in general programming Version2 should be able to load version 1 and version 2 anyways. Its completly getting rid of the datataccess layer so to speak and concentrating on the business objects and presentation which to me seems for more superior.
If a class is serialized and has events fired from it that are handled on a form you get the error "Form1 cannot be serialized" in c# you can use (to work around this):
I've noticed through out VB 2010 that when prompted through the intelli window to enter a POINT variable, you can just substitue X and Y values instead and this works. How do you program that option into custom classes?Make something like the code below allow X, Y coordinates to be passed instead of a POINT variable...
Code: Public Function GetCell(AtGridPoint as Point) as integer 'Returns the cell that the point is located in End Function
I have a copy of the Bible in txt format which I need to have altered. I wish to put the book name, the chapter number and a colon at the beginning of each verse, just before the verse number. The book name and chapter number can be obtained from the beginning of each chapter and each verse within each chapter is already numbered and on a separate line in the file.
I have a copy of the Bible in txt format which I need to have altered. I wish to put the book name, the chapter number and a colon at the beginning of each verse, just before the verse number. The book name and chapter number can be obtained from the beginning of each chapter and each verse within each chapter is already numbered and on a separate line in the file.
I have managed to create a connection to the database and am able to save information to it from my form, the form contains 22 textboxes, a save and another exit button. I have set the form to retrieve data in the form_load. I have used the "UPDATE" SQL command on the save button and it does save the data on all 22 textboxes (all textboxes are linked to their separate columns). But only one record will be needed that is why I did not use the "INSERT" command.
The problem arises when I click the save button, all (19) textboxes are saved but when I retrieve the text (by reloading the form), each of the 20, 21, 22 textboxes (only) the text of the 20th textbox keeps on moving tho the next textbox e.g. 20>21>22>20>21>22 is interchanged amongst themselves.
I have a datagridview that's bound to an access database, and it loads fine, and runs without errors, but it doesn't save. Here's my code:
Imports System.Data.OleDb Public Class Form1 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Dim myDA As OleDbDataAdapter
I'm working on a project which are generating some data from my VB.NET software and I wish to save those data into sql server. But my concerns is the speed of saving and the large amount of data. For every 0.5s, one set of data will be generated and the process will keep running for about 8 hours, so at the end of 8 hours, roughly there will be 60,000 set of data generated.May i know what is the best option/method of saving the data into the sql server in not hanging up my software and also keeping the pace with the speed of 0.5s data being generated?
- Speed of 0.5s. I have to maintained for every 0.5s, one data must be generated. Cannot delay too much.
- I can afford delay in the sql database, meant the data might not be necessary close to real time.
What is the best way on saving changes in datagridview into database? Whatever the user made changes in the datagridview will reflect right away in the database? The fastest and accurate way.
I created a database in access 2007, linked it to my project in visual studio 2008 (vb). When I enter some data using the UI, it does not save it in the database, and it's gone as soon as I run the program again. I dragged the textboxes from the datasource panel, onto the UI..
this is the code that was automatically generated by vs for the save button:
[code]Private Sub StaffBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StaffBindingNavigatorSaveItem.Click
I am developing a software for a restaurant which is owned by my sister. I would like a functionality that will make her send all purchased items into a listbox,and afterwards which will calculate for the total plus VAT. Whereby, there will be another button which will print out a items and the total from the listbox to a POS printer, and at the same time save into the sales database.
I'm saving data to a database, data from a listbox and checkboxes.In the listbox, on the form, there are 20 records and then there are 20 corresponding checkboxes.I need to save all 20 records to the database so really I need 20 new rows. What I have managed to get working so far is that it will save the last record only.Here is the code that works:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click 'setup the relationship objDataSet.Relations.Clear()
[code]...
but that's not right.How can I get to save 20 new rows to the database table?
im having problems saving and and updating my database. created in the database explorer.Run thorugh what ive done, created tables saved the job, imported the database dragged items on to screen.
Ive looked at my xsd file and Update and delete comands havent been set, how do i set them and is there a default to preset them when ive i create new databases. its really great you helped out..
Public Sub save_mandant(Optional ByVal SName As String = "") Dim set_temp As New DataSet Dim set_tables As New DataSet Dim ada_temp As New SqlDataAdapter("Select name from Sys.tables", SQLcon) ada_temp.Fill(set_tables, "T")
In my project the "teacher" must enter grades in the Grades database then save it and click the Semester Average button(btnSA)to display the grades in the database. Well I can't the the data to save. After I completely fill in the grades and click the save button in my tool strip I get the following error "OleDbException was unhandled: Command text was not set for the command object"
Public Class Form1 Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=GRADEBOOK.MDB"
I have read all the posts on this and tried a million different suggestions from the posts and I still can't get this and I don't know what I am doing wrong. I am new to working with DataGrids, Table Adapters, and Binding Sources so please bear with me.I have a form with a datagrid that loads when someone makes a selection in a combobox. I want the ability to make changes in the grid when they hit the save button. This is my data connection and variables, etc.
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=C:Documents and SettingsTodd LerewMy DocumentsVisual Studio 2008ProjectsPracticeAppPracticeAppTFPOperationsDatabase.mdb") Dim myAdapter As New OleDbDataAdapter
I am making a simple program in Visual Studio 2010.My program connects to a MySQL 5.5.8 database running on my computer through XXAMP. I have used the Connector/Net 6.3.7 for MySQL to allow me to do this.
This is the local information for the MySQL server: Server: 127.0.0.1 Port: 3306 (default) Username: root Password: admin
I have successfully created a Data Source for this server. The DataSet is called 'testdbDataSet'.
This is what my program looks like:I do not want to use the navigation bar that Visual Studio gives me at the top. Instead, I want to use the buttons shown below the input fields. The btnAdd button I believe should clear the two fields. It is currently working fine. I want the btnSave button to save the stored values of the two input fields to the database. I do not know how to do this.
this is roughly the add form where i have created... i am suppose to send this information into the database that i am using which is mysql.It is suppose to grab the incident date and the Type and also a count that increases by 1 if the date is the same or else it will be back to one.
This is the code Dim count As Integer Dim hotelcode As Integer
I am trying to make a program (kinda like a game, but no graphics). Well, everything on that is fine, and ive made this program once before in VB6, but that code is long gone and I am trying to make it again. Well, here is my issue. I want the users to be able to create items on the server end (as well as maps, npcs so on and so forth) and I was wondering if there is a way to do this without using a database? In VB6 I used several ini files, but this is not a recommended way of doing things anymore. I dont want each person that uses this to have to install SqlServer on their computer either.
i was working a program that has two forms. first form1 has a datagridview for viewing. with a button ADD and SAVE and disregardchanges.then when i click add another form2 with textboxes to input data. with buttons ADDTODATA, ADDANOTHER and CLOSE when i click ADDTODATA the data will add to datagridview in form 1 and when i click ADDANOTHER i also input another add ADD to datagridview to view.and when i get back to form 1 i have a choice if i will SAVE ot DISREGARDCHANGES. if i click save all data will save.
I used this code in adding data to table.
Dim dsNewRow As DataRow dsNewRow = ds2.Tables("NewEmpChildren").NewRow() dsNewRow.Item("dbIDNo") = txtIDNo.Text
[code]....
but nothing changes. it seems that my connection is close when i close form2. how can i make my connection still open when i close form two or any code that will substitute with my code. im a student and this is for my project.
I have a SQL Server database with a Table that has an image varbyte(max) field that I am using to store images. The issue is that when I am trying to insert an image in the field I need to .endEdit the dataSource before the assignment and again afer. If I don't do it before then nothing is stored. This of course only happens with the image, all other fields are updated without need to .endEdit.
Saving an Image to An SQL Database from a Visual Basic ASPNET.rtf?written in Visual Studio 2008, which is supposed to Insert Images into an SQL Database in Visual Basic ASP.NET I know it contains some errors but I can't point out exactly where I got it wrong?
I've got a list box and I want to save it to a database. I've tried treating it like a normal textbox with a max string length of 50. However this doesn't work for some reason.
Does any one know how to save a list box to the database, and preferably with a variable length, although the latter is not a necessity.
I think I have written code for saving All textbox's, maskedtextbox, datetimepicker,ombobox's ect.....I have a save button on a form called "SaveButton8" And what I want is when a user fills out the form, and when they click the savebutton8 I want all the froms, Textbox's, Maskedtextbox, Datetimepicker, Combobox's ect..... to save to the database. I have looked all over the forum with no sucess. here is my code:
Private Sub Button8_Click(sender As System.Object, e As System.EventArgs) Handles Button8.Click 'BookingTableBindingNavigatorSaveItem.PerformClick()