Reading/Updating From/to XML?

Jul 15, 2010

working with data in VB.NET, and the easiest method seems to be XML, since ini isn't supported. So I tried but couldn't find a way to read XML attributes and then replace/update them if needed. So for example I have this XML File:

<?xml version="1.0" encoding="utf-8"?>
<Entries>
<Entry1 font="Arial.ttf" R="255" G="255" B="255" effect="Stroke"></Entry1>
<Entry2></Entry2> - In the same format
</Entries>

How do I load those as strings, for example I want to write them to a file later, and I use the code:

sw.WriteLine("Font")

But instead I want to load the attribute from Entry1, instead of loading it from pre-defined variables. one more thing I want, when the user clicks a button to update an attribute (Font for example) to the current textbox text.

View 1 Replies


ADVERTISEMENT

MySQL Data Reading, Inserting, Updating?

Apr 22, 2010

I am a bit of a newbie when it comes to vb.net and databases and I have a small favor to ask anyone I am looking for a very basic example on how to connect, read, update and insert data into remote mysql database. I have successfully connected to my database with the code below,, and for the moment I am just trying to LIST data from it in a listview control,, and then would like to find a way to insert data into it and update data.

Al examples I find on the net are too long and usually have too many unnecessary data around the code I need so I get a bit lost in it.Can anyone point me in the direction of SIMPLE examples that are easy to follow or provide a bit of useful code I could learn form.

[Code]...

View 4 Replies

Status Updating While Reading Standard Output?

Dec 23, 2010

I use the following code to read the standard output from a command line application from a main winforms application, and then I use the BeginInvoke code to update a textbox with the status. What I am not sure about is if I can have a smoother process. The code loads up about 10 to 20 text inserts, and those are all seen at once... not a smooth process where each status is updated. Any thoughts on if the reading of the standard output and/or the beginvoke code could seem more smooth to the user?

Delegate Sub UpdateUIStatusHandler(ByVal StatusMessage As String, ByVal JobName As String, ByVal Direction As String)
Dim ProcessJob As New ProcessStartInfo(GSyncExe, RunJob)
ProcessJob.UseShellExecute = False : ProcessJob.CreateNoWindow = True : ProcessJob.RedirectStandardOutput = True : ProcessJob.RedirectStandardError

[code]....

View 3 Replies

VS 2010 Storing / Reading / Updating An XML File?

Apr 3, 2011

I have an application that gathers data from a SQL database that is used by a 3rd party helpdesk application.My application is pulling out information of the number of hours worked by each engineer for the current and previous 2 months.Also as part of this process, my application works out the target hours for each of those months.

My application has 3 groupboxes whose label is generated at runtime. My application gives the Groupbox1.text the name of the current month, Groupbox2.text the name of the previous month, and Groupbox3.text the name of the month before that (e.g. Mar, Feb, Jan).

What I am trying to do is have 2 text boxes for each month where I can enter the number of engineer holidays taken and the number of public holidays if any. I want to store these values in an XML file, and I guess they need to be stored to match the Groupbox text (i.e. Mar, Feb, Jan).

When the application starts, I need to parse that XML file and re-populate the text boxes with those number of days - BUT if the month has moved on, so that the Groupboxes are now called Apr, Mar, Feb then I want the Mar and Feb data to be loaded, and I want the XML file to be updated so that Apr is added and Jan is removed from it.I want the XML file to keep the current and previous two months figures only.

View 1 Replies

.net - Vista Seems To Prevent .net From Reading/updating File Attributes?

Jun 3, 2010

The following function copies a file from Source & Path to Dest & Path, normally setting file attributes to normal before copying.Yet, a user of my app has reported it to fail when copying readonly files, returning a permissions-related error. The user is however running the code as administrator, and the error happens - quite strangely - on the SetLastWriteTimeUtc line.Although the code reports that the file attributes are set to normal, windows explorer shows that they are set to read only.

[Code]...

View 1 Replies

Reading Or Updating The Video Capture Filter Properties

Jan 29, 2009

I'm looking for some help/examples on reading or updating the video capture filter properties in VB.NET. I am working with a USB video device that came on a Panasonic Toughbook. The camera has alot of functions that the user can set when running the software that came with the toughbook (zoom, bightness, contrast, etc)

[Code]...

View 1 Replies

Updating Child Collection Of POCO (adding/updating/deleting) In Entity Framework 4.1?

Jan 25, 2012

I have a webpage with a form that is used to edit some object. This object contains a Collection of other objects defined like this: Public Overridable Property Employees As List(Of Employee)

On a form I can delete an employee, add a new one or modify existing one. When I click save new values are sent to the server. On a server I check if the user exists. If exists then I modify its values, if it does not exist then I add it. All employees that exist on the server and were not sent are marked as deleted (State changed to EntityState.Deleted). I try to use the following code (dbCollection = database entities, newCollection = collection sent from the form):

[Code]...

This code does not work, because changing to EntityState.Deleted removes the object from collection, and for each loop breaks, since the collection is modified...I know that I can overcome this problem by using a for loop or adding objects to delete to some other list first, but I hope maybe there is a pattern that would make my code nicer.

View 1 Replies

Reading, Then Using, Then Reading Text File?

Jan 2, 2010

I am working on a project in VB 2008 and need it to do this:Read first line from text file (using Openfile)Enter line into textbox on formDo some other codeThen Read second linefrom text fileEnter line into same text boxand loop until we have gone through text fileI am not sure how to read line by line from text file then enter it in textbox. I can open the Openfile and get the filename and everything, but I just am not sure how to read from it or enter that line into the textbox.Here is what I have, its not much but its a start:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim FileReader As StreamReader

[code]....

View 4 Replies

SyncLock / Multithreading - Child Thread Reading The Values Of _do At The Same Time As Another Child Thread Is Reading The Values

Nov 13, 2009

I have a dictionary object (let's call it _do) I am using to cache some values for use in a multi-threaded program. I have a single controlling parent thread, with a timer function _doTimer() which can kick off child threads with a new instance of class MyThreadObject in each. My parent thread has _do as a property and with each time _doTimer() gets called, it may or may not repopulate _do depending on cacheflag settings. I pass a reference to _do to each instance of MyThreadObject and those threads at some point read the values of _do but DO NOT write to it.

What I want is to ensure that the child threads do not try and read _do whilst the parent thread is writing to it. Same thing but very slightly different -> I also don't want the parent thread to write to _do whilst the child threads are reading from it. However there is no problem with 1 child thread reading the values of _do at the same time as another child thread is reading the values - so ideally I do not want each child thread to completely lock out read access, only locking out Write access.. The code is roughly like this:

[Code]....

View 3 Replies

.net - WP7 - Updating A Listbox?

May 15, 2012

I've finally got around to starting windows phone dev. I'm not very good at it yet, but anyway, I hope you guys understand what I want to do here.From what I've learnt from other programmers, an ObservableCollection can be updated in live time whilst it is databound to an object, such as a listbox. All changes to the ObservableCollection will cause the UI of the object it's databound to update it's items.

So what I'm trying to do, is download a file from my server, parse it with json, then update the ObservableCollection with the new data. However, the webclient doesn't seem to be downloading the new data until the app is re opened!

[Code]...

View 1 Replies

.NET Progressbar Not Updating?

Apr 19, 2011

I am using a progressbar control in a splash screen.

In my code I am updating the progress bar value with each step -

In Form_Load of the main (hidden) form:

frmProg.UpdateProgress(10, "Checking Connection String")
CheckConnectionString()
frmProg.UpdateProgress(20, "Checking Crystal Reports OCX Files")
CheckOCXVersions()

[Code]....

Is there some event I can use to find out when the progress bar has finished redrawing?

View 4 Replies

Database Is Not Updating?

Feb 14, 2012

There is something wrong with my codes. I don't know why it isn't updating the records.If I activated the line dt.Rows.Add(newrow) it will just create an error on da.update(dt) line QuoteThe changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.But if I deactivate that line, no errors will be occurred but the record won't update.

Here is my code

Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter

[code]....

View 14 Replies

DataGridView Not Updating SQL

Jan 31, 2011

I have a data grid view bound to a sql server table. What I am trying to do is have changes made in the dgv update in the sql table. I tried to use the Update method of the table adapter but get the following error.[code]....

View 4 Replies

DataGridView Not Updating?

Jul 26, 2011

I have a datagridview with a datatable as datasource. If I add a row to the datatable, then the datagridview is not showing the contents.

grdChannel1.DataSource = CreateTable(colChannel)
Private Function CreateTable(ByVal colChannel As MyCollection(Of Channel)) As DataTable
'Create table and add collection into

[code]....

I have 2 row counts if I check the the row counts of the datagridview in the debugging mode.

View 1 Replies

Dictionary Keeps Updating Even When I Don't Want It To?

Mar 15, 2010

I have a dictionary of key=string and value=datatable. I use a key to retrieve a datatable and assign that datatable to a new variable. Then I make some updates to the variable. However, I find that the dictionary itself is being updated even though I'm only updating the variable. This causes significant issues when I try to reference the dictionary later. How can I set up my dictionary so that it won't update when I use a value?

dim dt1 as datatable

dt1=dictionary(key)

For row=0 to dt1.rows.count
dt1.Rows(row)(4)=dt1.rows(row)(4)/2
Next row

'at this point, when I look up dictionary(key), the value I get shows all of the original values divided by 2.

View 2 Replies

DSN Checking / Updating?

Apr 24, 2009

I just want to add a DSN if it does not already exist. I am looking at the registry and I know the DSN exists but this code returns False consistently.If(not isnothing(My.Computer.Registry.CurrentUser.OpenSubKey("SOFTWAREODBCODBC.INISQL_Finance", True)),True, False) Once I get past this the next step is to add the DSN if needed.

View 4 Replies

IDE :: Possible To Updating Datagridview?

Jul 18, 2009

I have a datagridview which i filled with this code:

Dim daProd As New SqlDataAdapter
m dsProd As New DataSet
cmd = New SqlCommand

[code].....

View 13 Replies

IDE :: Progress Bar Isn't Updating

Oct 4, 2011

I'm using VS2010 (VB), Framework 4.0 and although I'm incrementing my progress bar value between steps, the progress bar only shows the initial value. I've set the minimum and maximum properties and the initial value, but no luck. Here's a brief summary:

[Code]...

View 5 Replies

LINQ To SQL Not Updating Db?

Aug 31, 2011

I've read through the posts here and can't find any eureka answers so here's what I have.Linq to SQl not propagating a change back to the db.Here's my code. Does anything stand out?The call to dc.GetChangeSet shows 0 changes. What am I missing? I can see the new values from "setting" being set to the cs object properties. SettingID is a primary key in my table and shows as PK in the dbml so that's not an issue.

[Code]...

View 2 Replies

My BindingSource Not Updating

Jun 6, 2010

I'm trying to display a DataTable using a DataGridView and a BindingSource as such: (assuming the DataGridView1 and BindingSource1 has been added using the IDE)[code]...

View 3 Replies

My Database Not Updating

Jul 27, 2011

Whenever I try to update a row in my database, it works, but as soon as I restart the application, the changed information resets.[code]....

View 10 Replies

My DataTable Not Updating

Jul 22, 2009

I have a dataset which I load three tables into from the database. Each of these three tables are related by the AccountNo. On two of the tables I specify this field as a foreign key constraint with the appropriate cascading flags. However when I scroll through the list of companies with my combo box. Only the one table is having its values change on the form whereas the other tables remain static/unchanged.[code]...

View 5 Replies

SQL CE - Data Not Updating?

Mar 5, 2011

I'm using the following code to update a SQL CE database:

VB.NET
Public Sub SaveOldEntry(ByVal duration As String, ByVal checkinDate As String, ByVal receivedBy As String, ByVal platformName As String, ByVal serviceTag As String, ByVal

[code].....

View 10 Replies

SQL Not Updating Database?

Nov 10, 2011

I have the following sql query that on debugging contains what looks like the right thing however the database is not being updated, but the code runs fine:

con.Open()
For i = 8 To ds.Tables("AddressBook").Columns.Count - 1 'Counts the amount of columns in the database

[Code]....

View 9 Replies

TextBox Not Updating?

Nov 23, 2010

I'm trying to update a text field... in this manner:The main form (where I have the design)

View 11 Replies

Updating A .mdb Table In Vb?

Oct 14, 2009

I am trying to create an application which after selecting a target folder updates the files that are inside to an access database. The first part of the code here works fine as it allows me to choose a destination folder, but when trying to get it to update the cotents to the database it will not work.

This then means that when using code for another button to search and display files stored in the updated table in a combo box there are no objects attached meaning it creates an error stsaing it cnnot find the object or path.

The code is below

Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btDirectory.Click
' First create a FolderBrowserDialog object

[Code].....

View 1 Replies

Updating A Cell From A DGV?

Oct 9, 2011

I am updating a change in a DGV cell, but it wants to change all the rows to the same row info I picked to update. Must be a simple fix I can't dind.

Dim row As DataGridViewRow
For i As Integer = DataGridView1.SelectedRows.Count - 1 To 0 Step -1
row = DataGridView1.SelectedRows(i)[code].......

View 6 Replies

Updating A Database In Vb?

Jun 8, 2010

i am haveing problems updateing my customer details i was wondering if i could use the code i have for add and change it to update maby insted of useing the INSERT I could use a UPDATE or something anyway

Public Sub updateWithNewOrders(ByVal aOrder As Order)
Dim cmd4 As New OleDbCommand("INSERT INTO ORDER
(OrderID,CustomerID,OrderTotal,ODate,EmployeeId) VALUES (?, ?,?,?,?)", con)

[Code].....

View 3 Replies

Updating A Progress Bar?

Dec 6, 2010

I have been reading examples of using a progress bar with a background worker. All of the examples utilize a loop which is the easiest example of a progress bar. However there is the part of my code where I would like to use a background worker and progress bar. This part takes some time, thats why I want to use it. Basically its part of a DB front end where I am clearing oput 2 tables, getting data from another DB and populating the first 2 tables with the data from the first. Below is my code. How would I update a progress bar without a loop

View 1 Replies

Updating A Record In ADO.Net?

Jul 12, 2009

Essentially this section assigns a randomly generated password to a user if they have forgotten theirs. The password is generated in some other code.

I have set up the SQL to search for the log-in details (in the case and email address which is unique), it then brings in the field and then updates it to the new password.

But for some reason I cannot get it to update the MS Access Table.

I Keep getting a SYNTAX Error message.

Private Sub bthresendpassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bthresendpassword.Click
If txtemailaddress.Text = "" Then

[Code]....

View 6 Replies







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