Can Datasets Persist In VS 2008

Sep 4, 2009

I need to very quickly write an exe system on a laptop where when the laptops are connected to the network they read a database table and store the data locally, so staff can use the laptop while they roam.The laptops have quite small capacity and the company would prefer not to use SQL Express or Access.

My question is, can the data initially be downloaded into the exe application via a dataadapter and dataset, and will that dataset the retain the downloaded data, or will I need to ensure the dataset is written to an XML file and then loaded/unloaded each time the laptop application is started while the staff are travelling ?

View 2 Replies


ADVERTISEMENT

VS 2008 Datasets And Datagridviews?

May 23, 2010

I am novice at best with VB. I have a dataset built from a complex query. Well I have a lot more items in the dataset than I wish to show in a datagridview. Some items will be used for other purposes at the time, filling txt boxes, dropdowns, etc...all independent of the dgv. I am lost at how to fill just a 3 or 4 of the items rather than just filling the entire thing. So, instead of just filling the entire ds into the grid, how would I fill in selected columns into the datagrid that has specifically named columns at runtime?

View 2 Replies

Refreshing Datasets In VB 2008 Express

Mar 22, 2010

I have added a column to a table in SQL Server Express - the table is already included in my VB Express Dataset. However on clicking "Refresh" on the table in Database Exlorer I do not see the new column in the Database Explorer listings. I have looked around a bit for a solution to this but cannot find anything under Google.

View 10 Replies

VS 2008 - Datasets - UPDATE Command ?

Mar 3, 2011

I'm not sure if this belongs in the database section or the NET section. I will leave that up to the moderators. I have converted a few of my VB6 systems to NET. However, I have retained the ADO coding technique. I probably need to update that. Below is a sample from one of my applications. As you can see, I retrieve the data and, based on conditions, I then issue an UPDATE command. From what I have been reading (and not really grasping) a DATASET/DATA ADAPTER combination will do the same thing. If so, could somebody rewrite this small block of code using "proper" ADO.NET techniques. If I see my own code rewritten it will be much more meaningful to me.

Dim cnxn As New SqlClient.SqlConnection(cnxnstring)
cnxn.Open()
Dim sql As New SqlClient.SqlCommand
sql.CommandText = "SELECT * FROM PART WHERE LTRIM(RTRIM([PARTNUMBER])) = " & "'" & Trim

[CODE]...

View 5 Replies

VS 2008 No Data Showing In Datasets?

Oct 6, 2010

I set up SQL Server 2008 loaded VS2008 and all the ODBC drivers.All ODBC connections for DS and DGV's and using connection strings. I managed to get the connections working when I tested this on a new program.When I copy all the files from my other computer and try to view this it works with the connection string and connects to SQL server fine.But with the dgv I see nothing. Yet if I preview the datasets I get the result I am expecting

View 3 Replies

VS 2008 Completely Removing DataSets From Project?

Apr 5, 2009

Whilst playing around with DataGridViews in VS I've accumalated quite a few TestDataSets within my project.

Can someone please tell me the correct way of removing these cleanly? At the moment I've been Right Clicking a DataSet (from within Solution Explorer) and either clicking 'Delete' or 'Exclude From Project'

Doing this throws up Errors in the Error list such as;

TestDataSet is not defined
TestDataSetTableAdapters is not defined
TestDataSet is not defined
TestDatasetTableAdapters is not defined

I then double click each error in turn which takes me to the actual code with the error and delete this.

I have quite a lot of TestDataSets and I'm hoping there is another way to do this much cleaner.

View 4 Replies

VS 2008 Opening Up New Form Instances With Different Datasets?

Mar 24, 2009

I�m fetching data from an access db, filtered by date and an ID. The data is then charted on a form (form1).

I want to be able to "duplicate" the form so that the data that is shown on form1 is shown on a different form. That forms data is not supposed to change when I change the data on the first form.

So far I�ve put som code in a contextmenustrip that opens another form1, but the chart is not showing on that form at all.

I'm thinking that I'm going about this the wrong way so I thought I'd ask you guys what you think I should do?

A little info: When Form1 opens up, it loops through selected dates in a listbox, querying each date. This takes a little time, so I decided to put the data in a dataset on form_load, and then do the drawing from the dataset on form_paint, thus not having to query the database each time the form needs repainting. why the second (or third, fourth etc) form1 doesn�t display the chart?

View 2 Replies

VS 2008 - Application That Uses An Access Database To Fill Datasets

May 13, 2010

I have an application that uses an access database to fill datasets. My problem is that I have three related tables, when I add a new users to the customers table The parts table fills with data saved in the database with a cust_id of -1.

I discovered that this is caused by adding a part, not saving it and deleting the customer. I Can add code to stop the user from deleting a customer that has parts but I do not have access to the live database to delete the record that are incorrect.

Is there something I can do to delete the rows that have an id of -1 on the load statment?

View 1 Replies

Using VB 2008 & Access 2007 For Windows Forms Application Having Typed Datasets?

Nov 20, 2010

I am using VB 2008 & Access 2007 for windows forms application having typed datasets while creating connection to DB vb asks to store connection string so i did it now that i want to know where is the actual path of file where these connection strings are stored. b'cas after runnig a macro in Access Database i lost all these connections from Data Source Configuration Wizard Combo Box & also i am anable to create a new connection to Databases.I have tried to reinstall the entire Visual Studio couple of times .

View 17 Replies

Persist The Datagridview Changes?

Mar 1, 2011

I have a datagridview in a form that is dynamically bound to a datatable. When the user clicks a button I update certian columns of the current row with code like this:

Dim i As Integer = myDataGridView.CurrentRow.Index
Me.myDataGridView.Item("closed", i).Value = DBNull.Value

View 4 Replies

A Boolean Value Does Not Persist After Publishing

May 1, 2009

I'm working with Visual Basic 2008 Express. My application opens with the Terms screen, a form that asks the user to declare his acceptance of certain terms and conditions or to decline. If he accepts, the app opens the main screen, giving him access to all the app's facilities. If he declines, the app gives him a message and then closes. Whether he chooses to accept or decline, the app puts his decision in My.Settings so that it can be used next time the app is opened. In this way he is presented with the Terms screen on the next opening if he declined on the last run. But if he accepted on the last run, he is presented with the main screen on his next opening.

All works fine when I do a debug run. But when I build and publish the app onto my desktop it opens with the Main screen instead of the Terms screen.

why it works on F5 but not after publishing?

Public
Class frmTerms
Dim Accept As Boolean

[Code].....

View 11 Replies

IDE :: Windows Service - How To Persist A Value

Jun 6, 2012

I am a web developer who now has to change a Windows service. I never worked on a Windows service before. I have a several programs that can run within this service. I want to persist a value of a variable from program to program.

View 1 Replies

Viewstate Does Not Persist After Postback

Mar 21, 2012

I'm having some problems in persisting the viewstate on postback for a Control (vb.net)

here's some code i've put in my control[code]...

I'm setting EnableViewState = "true" everywhere i can, but still no result. Do i really need to set those properties here. (ViewStateMode and EnableViewState) If not, where should i handle this and what is the difference between those properties?

View 4 Replies

C# - Private Key Does Not Persist Even With X509KeyStorageFlags.PersistKeySet

Dec 9, 2010

I have been searching for quite a while now but i am unable to find the answer to the following. I am storing a key pair in Windows Store, and recently started receiving the "Keyset does not exist" error. Investigating a bit further i found out it could be two things, 1 - The private key is not stored with the persist key set attribute (X509KeyStorageFlags.PersistKeySet) and 2 - access rights to the key. I have tried both 1 and 2 with no success on one machine (in my machine it works apparently). The strange thing is that when i look into MicrosoftCryptoRSAMachineKeys (and S-1-5-18) the key remains there but only for a period of time then it is deleted which means that it is not persisting.

//If decoded then save as RSACryptoServiceProvider
newCert.PrivateKey = DecodePrivateKey(privateKeyFile, pkPassword)
if (newCert.PrivateKey == null)

[Code]....

I have just found out today that since i am doing this through a WCF service, the application pool is deleting the private key when it reaches its idle time limit so i am completely sure that it is the application pool the one disposing of the private key which causes the key to be deleted from the MicrosoftCryptoRSAMachineKeys and S-1-5-18 folders. Today i left a test running where i disabled Idle time shut down from the application pool bu i am still not sure if the private key will stop persisting with a restart or something like that?

Would anybody know how to make the application pool stop deleting my private keys?

View 2 Replies

Getting ListView Data To Persist After Shutdown?

Jan 13, 2011

I need some general advice about using ListView. The program was originally written in VB2002, but now it's running in VB2008.The results of my program would typically be a ListView of 30 lines by 8 columns. I need to be able to save this data so that it persists after I close the program. There will never be a need to manipulate the data, so I'm looking for something simple. (There will be a need to print it.) I'm presuming that I need to link to a database to save the data. Correct? If so, can I use the one in Microsoft Works (which I already have), or do I need to get Microsoft Access, or is there some other better (simpler?) alternative?

View 7 Replies

Persist Browser Scroll Position

Oct 10, 2011

I'm looking for a simple, efficient way to get the position of the browser vertical scrollbar and save it into a session variable in an ASP page. What I'm trying to do is when the user changes a page I've the scroll position stored in a session variable so that when the user returns to the page the page will scroll to their last position.Is there a way to do this? I've seen examples of persisting the scroll position on postback but nothing yet doing exactly what I'm trying to do [code]

View 1 Replies

Persist Control Location On A Form?

Jun 16, 2010

I need to save the controls location and size on the parent form to file. My aim is to be able to simply copy that file to the path where an instance of my program is running and then it automatically applies the previously saved layout of controls. How can I use My.Settings to do that or is there another better option?

View 12 Replies

Adding A Variable That Will Persist When The Program Closes?

Jul 26, 2011

Sorry for the extra long title, Here's what I want to do.I want to give the user the option of using or not using specific features of the program.If I can set a simple yes or no value that wil persist each time the program run and then depending on the variable turn off or on the feature at start

View 14 Replies

Connection String Persist Security Info?

Jun 27, 2010

does anyone knwos what is the point of persist security info? i have always leave it at default (i'm not sure what value it is) but when i pass the application to my friend he seem not to be able to connect to the db. (btw the application calls

View 2 Replies

How To Persist Anonymous Types Instances Through NHibernate

Feb 12, 2010

Instinctively, I would say that this is impossible, as NHibernate needs to know some mapping information on how to persist a given type. Thus, I encountered some situations in which I could use such a feature. For instance, through a named query or something like so. On the other hand, using a named query would require me to make an addition to the configuration file.

Let's suppose we have an application interacting with some underlying datastore. This datastore is configured through the NHibernate configuration file. Then, I wish to have NHibernate load only a subset of an entity properties, from another subsystem to which my application shouldn't need to interact much, so it is not worthy to define classes for this system, as I only need a fraction of this alien system's information, let's say three out of thirty-two data columns. For that matter, if I chose to load only those three columns let's say for performance concerns, I would then use an anonymous type, perform the required action onto this information, then persist it back to the datastore. Now, it wouldn't be of much interest to do so if I only had one entity to get loaded from the datastore, so let's say I have about 75,000 rows to load into my process. I then shall consider this subset option very seriously!

What strategy should you choose in such situation, if you needed to persist these changes to a subset only of this entity's properties?FYI: I am asking because I must write specific rules of usage with NHibernate, such rules that even a beginner developer would even be able to use it without knowing too much about NHibernate, but only following the rules and guidance of the technical documents I have to produce.

View 1 Replies

C# - Implementing Transaction Processing To Persist Application Data

May 27, 2011

Let's say an application needs to persist mostly immutable data. Let's say the application's data files can grow fairly large. How would you implement a simple transaction processing so that changes are either successfully committed or rolled back?

The only requirement is to use built-in .Net libraries. (no databases, no third party libraries)

Here's my current solution. The data file will have three main sections: (1) header, (2) data, (3) index. For now, the header section simply contains an offset to the start of the index section. The data section will store mostly immutable data. The index section will contain serialized objects with enough information to access the data section.

When the application starts, it only needs to deserialize objects from index section. Anything from the data section can be fetched as needed. As the application gets ready to write changes, it makes a temporary copy of the original header and index sections. These would be small relative to the data section. New data would then be appended to the original data section. Once all data has been written, in memory objects would be serialized to the end of the file to become the new index section.

If all this goes without a hitch, the temporary file can be deleted. If something goes wrong, the temporary file can be used to restore the data file to its original state.

Will this work or is there a more elegant approach?

View 1 Replies

Persist A Value In An Inherited Class Or Create A Custom Parameter?

Apr 15, 2012

I am making some changes to a fairly old project.It has a DataGrid with an Inherited Class

Public Class CustomDataGridTextBox
Inherits DataGridTextBoxColumn

and a Override Sub Protected Overloads Overrides Sub Paint (.......What it was doing was alternating the Data Grid Line colours New Requirement is to break up some items in the DataGrid By categories So I have added new lines to the data and sorted so they show up ad category headers (Production Stations) And they would like the Category Header to be a different colour and then the alternating line colours to restart.This did not sound too difficult but that has proven a trap Setting the category header is no problem but restarting the alternating colours is Previously the row was determined to be odd or even to set the colour.Now I am intending to use an Integer to define what colour is used but it persists only for that text box.

How can I get it to extend its life so each call can refer to it and update it and set the desired colour?All I need to do is have an integer variable that will hold its value for the next call?

View 11 Replies

ASP.NET - Persist A GridView's Dynamically Chosen DataSourceID Over Multiple Button Clicks?

Nov 11, 2009

I have an app where I need to dynamically choose an SQLDataSource for a GridView so I can use 1 of 2 stored procedures, depending on who is logged into the system. My problem is that I am using logic like this, in the button click...

If Session("SiteType") = "Type1" Then
GridView1.DataSourceID = "SqlDataSource2"
Else

[code]....

This happens when you click the button that reveals the panel with the gridview in it. The user then makes changes (basically adjusting a text box on one or more liens of the grid) and then clicks "save". However, the gridview no longer knows its DataSourceID once this happens, so when I try to go through the gridview's rows - there are none.

If, in the save button's click, I put the same code, it (of course) blanks out any of the data changes I made in the form. So, simply put - how do I dynamically choose the SqlDataSource, but only one time, so that the program then keeps that SqlDataSourceID associated with the gridview until the end of the cycle? Is this a ViewState thing? I don't totally understand ViewState...

View 3 Replies

Sql Server - Rolling Back Entity Framework Transaction, Cached Item Persist?

Aug 23, 2011

I'm using an Entity Framework context, and sometimes would like to create a transaction so that the client can do multiple changes and then commit/rollback them all together.However, if many changes were made, and SaveChanges() was called multiple times, after which a rollback is called, entities that were commited already, will remain the way they were commited, and would not roll back.Here's how my transaction-relative functions look like:

Public Sub BeginTransaction()
Dim context = HttpContext.Current.GetObjectContext()
If Not context.Connection.State = ConnectionState.Open Then
context.Connection.Open()
End If

[Code]...

Not only does the test fail, but it also leave the ObjectContext in an unstable mode, because it still has invalid changes in it.

View 1 Replies

C# - Persist Dropdownlist Selection Located In A Control Located In A Masterpage?

Apr 1, 2012

I have default.aspx used masterpage, in master page i have a control called DefaultMenuContent, this control have a dropdownlist with autopostback, the problem is loosing the selection even if i use Is Not PostBack in control's load event, how to persist the dropdownlist selection?

In Master:

<asp:ContentPlaceHolder ID="MenuContentPlaceHolder" runat="server">
<art:DefaultArabicMenu ID="DefaultMenuContent" runat="server" />
</asp:ContentPlaceHolder>

[code]....

View 1 Replies

Persist Program Parameter And Variable Settings From One Run Of The Program To The Next?

Aug 2, 2009

I want to hear some discussion regarding what is the best way to persist program parameter and variable settings from one run of the program to the next. I used to often use the ubiquitous INI type file in VB6 programs but I am aware that these are not formally supported in .Net programs. I also have a major aversion to adding to the already overwhelming bloat of the Windows registry by using that to store values.

[Code]...

View 6 Replies

How To Use DataSets

Jul 30, 2009

I'm trying to work with an ODBC driver for Interbase in VS2008 (vb). I succesfully inserted the data tables I want to use in the project datasource. Then I want to add some rows in one of the tables of the datasource. I used myDataSet.addTABLENAMErow(field1, field2, ...).The compiler gives me no error, but when I open the database with InterbaseConsole, the line I've add is not there. Do I do something wrong? Must I open/save the database (how do I do so). I've tried meDataSet.AcceptChanges whitout result.I'm not used to work with Datasets and tables...

View 1 Replies

Debugging And DataSets?

Jan 29, 2010

Anyway to view the content of a dataset or datatable in debug? I don't mean looking up a specific element of the dataset but to view the hole thing.

View 4 Replies

Difference Between Two Datasets?

Mar 14, 2009

difference between the two statements given below

1. Dim ds as new DataSet

2.Dim ds as DataSet = New DataSet

View 2 Replies

How To Combine Two DataSets

Oct 8, 2010

I'm trying to combine two datasets, each with 1 datatable and each having the same schemas. Datatable 1 would have a list of records. Datatable two may, or may no, have some or all of the records from table 1 plus more records. I would like to remove all the records from table 2 that are present in table 1.

This is what I got so far:
For Each table1 As DataTable In ds.Tables
For Each row1 As DataRow In ds.Tables(0).Rows
ds.Tables(0).PrimaryKey = New DataColumn() {ds.Tables(0).Columns(0)} 'Where 0 is the index of the column that's your key
row2 = ds2.Tables(0).Rows.Find(row1("ID"))
'if its found, delete it
Next
Next

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved