473,568 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What to search for

Hi sorry for the quick question. I am on the right track but just cant seem
to find what to search for in my books / online for the answer I am looking
for.

I have created a dataset within my project.
In the dataset I created 2 tables - and set some fields on the tables.
In each table I set one of the fields to be a primary key / unique auto
incremenet.

So now I create a form, add a datagrid view to it and add to the dataset.
Works great. The unique keys are "negative" as expected.
If i was actaully pushing this to a sql server...on push i would expect it
to come back as a positive.

But I am not..
After this step I am writing the dataset to an XML file, but it still has
"negatives" there.
How to I get it to write to the xml file with "Positive Keys".
Basically make the XML file be my 'sql server'.

I can load and save my changes to the xml file - but the negatives are
there.
Or am i mislead, and using primary keys on an xml file will always be like
this - until you take it and write the contents into a real server
filesystem?

So I am not sure what to search for / google on "XML vb.net unique key
dataset" or something to find out how people use an xml file as a file
system.

Thanks.

Miro

Sep 4 '08 #1
8 1135
Miro wrote:
Hi sorry for the quick question. I am on the right track but just cant
seem to find what to search for in my books / online for the answer I am
looking for.

I have created a dataset within my project.
In the dataset I created 2 tables - and set some fields on the tables.
In each table I set one of the fields to be a primary key / unique auto
incremenet.

So now I create a form, add a datagrid view to it and add to the dataset.
Works great. The unique keys are "negative" as expected.
If i was actaully pushing this to a sql server...on push i would expect
it to come back as a positive.

But I am not..
After this step I am writing the dataset to an XML file, but it still
has "negatives" there.
How to I get it to write to the xml file with "Positive Keys".
Basically make the XML file be my 'sql server'.

I can load and save my changes to the xml file - but the negatives are
there.
Or am i mislead, and using primary keys on an xml file will always be
like this - until you take it and write the contents into a real server
filesystem?

So I am not sure what to search for / google on "XML vb.net unique key
dataset" or something to find out how people use an xml file as a file
system.

Thanks.

Miro
It's not the primary key setting that makes the values change, it's that
the field is specified as identity in the database.

When you save the data as XML, there is no identity field that can
create new unique values.

--
Göran Andersson
_____
http://www.guffa.com
Sep 4 '08 #2
Ahh I see, so I can also assume that it being negatives ( and since they are
hidden fields ) technically 'who cares'.
That or I run thru the dataset, find the next number in sequence and do it
myself.

Thank you very much.

Miro

"Göran Andersson" <gu***@guffa.co mwrote in message
news:Or******** ******@TK2MSFTN GP03.phx.gbl...
Miro wrote:
>Hi sorry for the quick question. I am on the right track but just cant
seem to find what to search for in my books / online for the answer I am
looking for.

I have created a dataset within my project.
In the dataset I created 2 tables - and set some fields on the tables.
In each table I set one of the fields to be a primary key / unique auto
incremenet.

So now I create a form, add a datagrid view to it and add to the dataset.
Works great. The unique keys are "negative" as expected.
If i was actaully pushing this to a sql server...on push i would expect
it to come back as a positive.

But I am not..
After this step I am writing the dataset to an XML file, but it still has
"negatives" there.
How to I get it to write to the xml file with "Positive Keys".
Basically make the XML file be my 'sql server'.

I can load and save my changes to the xml file - but the negatives are
there.
Or am i mislead, and using primary keys on an xml file will always be
like this - until you take it and write the contents into a real server
filesystem?

So I am not sure what to search for / google on "XML vb.net unique key
dataset" or something to find out how people use an xml file as a file
system.

Thanks.

Miro

It's not the primary key setting that makes the values change, it's that
the field is specified as identity in the database.

When you save the data as XML, there is no identity field that can create
new unique values.

--
Göran Andersson
_____
http://www.guffa.com
Sep 4 '08 #3
Miro,

In my idea that is not the right way, because now you have to write the
DataSet with the diffgram option.

Why not simple use a GUID as identifier and leave that old Access way behind
you.

Cor

"Miro" <mi**@beero.com schreef in bericht
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
Ahh I see, so I can also assume that it being negatives ( and since they
are hidden fields ) technically 'who cares'.
That or I run thru the dataset, find the next number in sequence and do it
myself.

Thank you very much.

Miro

"Göran Andersson" <gu***@guffa.co mwrote in message
news:Or******** ******@TK2MSFTN GP03.phx.gbl...
>Miro wrote:
>>Hi sorry for the quick question. I am on the right track but just cant
seem to find what to search for in my books / online for the answer I am
looking for.

I have created a dataset within my project.
In the dataset I created 2 tables - and set some fields on the tables.
In each table I set one of the fields to be a primary key / unique auto
incremenet.

So now I create a form, add a datagrid view to it and add to the
dataset.
Works great. The unique keys are "negative" as expected.
If i was actaully pushing this to a sql server...on push i would expect
it to come back as a positive.

But I am not..
After this step I am writing the dataset to an XML file, but it still
has "negatives" there.
How to I get it to write to the xml file with "Positive Keys".
Basically make the XML file be my 'sql server'.

I can load and save my changes to the xml file - but the negatives are
there.
Or am i mislead, and using primary keys on an xml file will always be
like this - until you take it and write the contents into a real server
filesystem?

So I am not sure what to search for / google on "XML vb.net unique key
dataset" or something to find out how people use an xml file as a file
system.

Thanks.

Miro

It's not the primary key setting that makes the values change, it's that
the field is specified as identity in the database.

When you save the data as XML, there is no identity field that can create
new unique values.

--
Göran Andersson
_____
http://www.guffa.com
Sep 5 '08 #4
In my scenario I created - I am trying to create a dummy poker timer for him
and save his settings to an xml file.
That way sql express doesnt need to be installed or anything.
(Basically 1 step up from a csv file - so I can learn a bit on how to use
xml files - and he gets a dummy poker timer )

So this xml file is never shared by anyone / never used by multiple people
at the same time. It basically just stores the rounds & blinds.

With a scenario like this - yes I see how a GUID would be better than my
unique auto-incrementing key.
Because with this scenario - if i use my auto-incremeneting key idea - yes
everything works - but its still a negative# that is written to the xml
file. Your GUID would fix it - or I would have to manually run through and
search for negative keys and convert them to positive ones.

I am now just trying to think of an example ( cause I thought a poker timer
would be simple enough ), where my xml idea with keys would work.
But from what I have come to learn, is basically - if "I/Anyone" plans to
use an xml file as a 'settings file (like in my case)", then if I want to
have keys - I should ALWAYS use a GUID as the key, and the Unique
Auto-Increment Key setting - use that only if ever connecting to a database.

Is that a correct assumption?

Miro

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:5A******** *************** ***********@mic rosoft.com...
Miro,

In my idea that is not the right way, because now you have to write the
DataSet with the diffgram option.

Why not simple use a GUID as identifier and leave that old Access way
behind you.

Cor

"Miro" <mi**@beero.com schreef in bericht
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
>Ahh I see, so I can also assume that it being negatives ( and since they
are hidden fields ) technically 'who cares'.
That or I run thru the dataset, find the next number in sequence and do
it myself.

Thank you very much.

Miro

"Göran Andersson" <gu***@guffa.co mwrote in message
news:Or******* *******@TK2MSFT NGP03.phx.gbl.. .
>>Miro wrote:
Hi sorry for the quick question. I am on the right track but just cant
seem to find what to search for in my books / online for the answer I
am looking for.

I have created a dataset within my project.
In the dataset I created 2 tables - and set some fields on the tables.
In each table I set one of the fields to be a primary key / unique auto
incremenet .

So now I create a form, add a datagrid view to it and add to the
dataset.
Works great. The unique keys are "negative" as expected.
If i was actaully pushing this to a sql server...on push i would expect
it to come back as a positive.

But I am not..
After this step I am writing the dataset to an XML file, but it still
has "negatives" there.
How to I get it to write to the xml file with "Positive Keys".
Basically make the XML file be my 'sql server'.

I can load and save my changes to the xml file - but the negatives are
there.
Or am i mislead, and using primary keys on an xml file will always be
like this - until you take it and write the contents into a real server
filesystem ?

So I am not sure what to search for / google on "XML vb.net unique key
dataset" or something to find out how people use an xml file as a file
system.

Thanks.

Miro

It's not the primary key setting that makes the values change, it's that
the field is specified as identity in the database.

When you save the data as XML, there is no identity field that can
create new unique values.

--
Göran Andersson
_____
http://www.guffa.com
Sep 5 '08 #5
Miro wrote:
In my scenario I created - I am trying to create a dummy poker timer for
him and save his settings to an xml file.
That way sql express doesnt need to be installed or anything.
(Basically 1 step up from a csv file - so I can learn a bit on how to
use xml files - and he gets a dummy poker timer )

So this xml file is never shared by anyone / never used by multiple
people at the same time. It basically just stores the rounds & blinds.

With a scenario like this - yes I see how a GUID would be better than my
unique auto-incrementing key.
Because with this scenario - if i use my auto-incremeneting key idea -
yes everything works - but its still a negative# that is written to the
xml file. Your GUID would fix it - or I would have to manually run
through and search for negative keys and convert them to positive ones.
Why would negative key values be a problem in the first place?
I am now just trying to think of an example ( cause I thought a poker
timer would be simple enough ), where my xml idea with keys would work.
But from what I have come to learn, is basically - if "I/Anyone" plans
to use an xml file as a 'settings file (like in my case)", then if I
want to have keys - I should ALWAYS use a GUID as the key, and the
Unique Auto-Increment Key setting - use that only if ever connecting to
a database.

Is that a correct assumption?
No.

A GUID is excellent if you have distributed data, i.e. you need to
create unique keys without having all the data available at the moment.
In your case your data is limited to your xml file, so you always have
all the data. Therefore you can always create a unique value without
problem, and the usefulness of a GUID is very small.

--
Göran Andersson
_____
http://www.guffa.com
Sep 5 '08 #6
"Göran Andersson"
A GUID is excellent if you have distributed data, i.e. you need to create
unique keys without having all the data available at the moment. In your
case your data is limited to your xml file, so you always have all the
data. Therefore you can always create a unique value without problem, and
the usefulness of a GUID is very small.
Why is an incremental identifier better, it gives me always troubles which a
GUID does not.

I only use an incremental value for a key as I want the key have an
incremented number, but that is as well not the case in this situation.

Cor
Sep 6 '08 #7
Cor Ligthert[MVP] wrote:
"Göran Andersson"
>A GUID is excellent if you have distributed data, i.e. you need to
create unique keys without having all the data available at the
moment. In your case your data is limited to your xml file, so you
always have all the data. Therefore you can always create a unique
value without problem, and the usefulness of a GUID is very small.

Why is an incremental identifier better, it gives me always troubles
which a GUID does not.
It's smaller and faster. I use identity fields all the time, and don't
have any troubles with them.

In this case the advantage of the incremental identifier is that it's
already there, created automatically. To use a GUID you have to
specifically create them.
I only use an incremental value for a key as I want the key have an
incremented number, but that is as well not the case in this situation.
I use an identity field as the simplest way of creating a unique key,
never to create an incremental value. If you need to rely on a value
being truly incremental, you should create the values yourself so that
you are sure that they really are.

--
Göran Andersson
_____
http://www.guffa.com
Sep 6 '08 #8
In my case I really dont care what they are, i just need a unique key for
some files.

I'll play with both, I was just under the impression that I was writing
something wrong - and getting negative keys to my xml file.
The dataset I knew was ok - the actual xml file I did not know.

Miro

"Göran Andersson" <gu***@guffa.co mwrote in message
news:Od******** ******@TK2MSFTN GP06.phx.gbl...
Cor Ligthert[MVP] wrote:
>"Göran Andersson"
>>A GUID is excellent if you have distributed data, i.e. you need to
create unique keys without having all the data available at the moment.
In your case your data is limited to your xml file, so you always have
all the data. Therefore you can always create a unique value without
problem, and the usefulness of a GUID is very small.

Why is an incremental identifier better, it gives me always troubles
which a GUID does not.

It's smaller and faster. I use identity fields all the time, and don't
have any troubles with them.

In this case the advantage of the incremental identifier is that it's
already there, created automatically. To use a GUID you have to
specifically create them.
>I only use an incremental value for a key as I want the key have an
incremented number, but that is as well not the case in this situation.

I use an identity field as the simplest way of creating a unique key,
never to create an incremental value. If you need to rely on a value being
truly incremental, you should create the values yourself so that you are
sure that they really are.

--
Göran Andersson
_____
http://www.guffa.com
Sep 7 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1554
by: bdawg | last post by:
what i want to do is create several radio buttons and a textbox for searching purposes. the search will perform a search depending on which button the user selects. here is what i have now: - for each radio button, i use the onClick event handler, which calls a function called showMe() - showMe() {
14
2197
by: Frances Del Rio | last post by:
if (parent.frames.main.location == 'mediaselect.html') { I have a very simple frameset, name of frame where I'm checking is 'main'... why is this not working? I mean this is correct syntax, right?? I also put a test alert, but alert does not come up if file I'm testing for is loaded in 'main' frame.. thank you.. Frances
8
1668
by: Steve | last post by:
I notice that search engines are now finding robots.txt files and catalogue their contents. Is this wise I wonder? Is it a possible security risk? I even found the White House robots.txt file on Google. Surely disclosing detains of the directory structure is an open invitation for hackers to 'take a look'? Does anyone else feel the same...
121
9969
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather...
6
1668
by: ashishnh33 | last post by:
cud any one tell me what is the problem in this program #include<iostream.h> #include<conio.h> #include<stdlib.h> int binarysearch(void) int linearsearch(void) class search { private: int,beg,mid,end,,i,j,n,item;
5
5893
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique CompanyID's. The second combobox will contain unique memberID's. Each of the tables that I have to search contain a CompanyID and a memberID field, and...
6
1312
by: Jeff Gardner | last post by:
Greetings: I am attempting to get conditional output based on POSTed form data. If the posted value is either the key or value of an array, $x=key and $q=foo. elseif it is neither key nor value(I tried || too) , $q=bar. Even though $x is properly assigned the new value, $q always ends up being bar. Abstractions aside, here's the code: ...
3
1771
by: Harry Haller | last post by:
What is the fastest way to search a client-side database? I have about 60-65 kb of data downloaded to the client which is present in 3 dynamically created list boxes. The boxes are filled from 3 string arrays, which are just lists of people or companies in alphabetic order. These names may have accented and umlauted characters (which are...
1
2415
by: Harry Haller | last post by:
What is the fastest way to search a client-side database? I have about 60-65 kb of data downloaded to the client which is present in 3 dynamically created list boxes. The boxes are filled from 3 string arrays, which are just lists of people or companies in alphabetic order. These names may have accented and umlauted characters (which are...
11
3499
by: emailus | last post by:
I am webmaster for the domain <www.alpha1.org.au>. Not being an expert in html, I take advantage of my domain Registrant's web building tool, 'Instant Website'. This tool is provided as part of the fee I pay for web hosting. 'Instant Website' provides the option of having your opening page as a Flash Page, which you'll see if you visit...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.