Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel 9 1315
Hi Miguel,
can you show code please,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project: http://www.codeplex.com/restarts
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"shapper" <md*****@gmail.comschrieb im Newsbeitrag
news:cb**********************************@d45g2000 hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
A Guid cannot be null, unless you declare it Guid?.
"shapper" <md*****@gmail.comwrote in message
news:cb**********************************@d45g2000 hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
On Sep 8, 3:42*am, Kerem Gümrükcü <kareem...@hotmail.comwrote:
Hi Miguel,
can you show code please,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project:http://www.codeplex.com/restarts
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"shapper" <mdmo...@gmail.comschrieb im Newsbeitragnews:cb******************************** **@d45g2000hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
album.Add(new XElement("img",
new XAttribute("id", paper.Slide.SlideID ??
Guid.NewGuid())
));
paper.Slide is an object. So if it's SlideID, which is Guid, had no
value assigned then a new guid is used.
This seemed logic to me until I got the error :-)
On Sep 8, 4:07*am, "Family Tree Mike"
<FamilyTreeM...@ThisOldHouse.comwrote:
A Guid cannot be null, unless you declare it Guid?.
"shapper" <mdmo...@gmail.comwrote in message
news:cb**********************************@d45g2000 hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
Well, I can do this:
Guid id = new Guid();
And yet the Guid value is not defined.
"shapper" wrote:
On Sep 8, 3:42 am, Kerem Gümrükcü <kareem...@hotmail.comwrote:
Hi Miguel,
can you show code please,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project:http://www.codeplex.com/restarts
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"shapper" <mdmo...@gmail.comschrieb im Newsbeitragnews:cb******************************** **@d45g2000hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
album.Add(new XElement("img",
new XAttribute("id", paper.Slide.SlideID ??
Guid.NewGuid())
));
paper.Slide is an object. So if it's SlideID, which is Guid, had no
value assigned then a new guid is used.
This seemed logic to me until I got the error :-)
Since SlideID is a Guid it cannot be null. Therefore SlideID ?? makes no
sense. Now, if you make SlideID a Guid? (nullable Guid) your code should
work.
--
Happy Coding!
Morten Wennevik [C# MVP]
Hi shapper,
Yes, but cant Guid id = null. Basicaly, ?? aplied for reference and nullable
types. http://msdn.microsoft.com/en-us/libr...24(VS.80).aspx
Regards, Alex
blog: devkids.blogspot.com
Well, I can do this:
Guid id = new Guid();
And yet the Guid value is not defined.
On Sep 8, 6:08*am, Morten Wennevik [C# MVP]
<MortenWenne...@hotmail.comwrote:
"shapper" wrote:
On Sep 8, 3:42 am, Kerem Gümrükcü <kareem...@hotmail.comwrote:
Hi Miguel,
can you show code please,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project:http://www.codeplex.com/restarts
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"shapper" <mdmo...@gmail.comschrieb im Newsbeitragnews:cb******************************** **@d45g2000hsc.googlegroups.com...
Hello,
I am inserting an item on a XML file and I have something like this:
paper.ID ?? Guid.NewGuid()
Basically my idea was that if paper.ID is null then create a new Guid.
It says it is not possible to use ?? with Guid. Is there another
option to do this?
Thanks,
Miguel
* * * album.Add(new XElement("img",
* * * * * * * * * new XAttribute("id", paper.Slide.SlideID ??
Guid.NewGuid())
* * * * * * * * ));
paper.Slide is an object. So if it's SlideID, which is Guid, had no
value assigned then a new guid is used.
This seemed logic to me until I got the error :-)
Since SlideID is a Guid it cannot be null. *Therefore SlideID ?? makes no
sense. *Now, if you make SlideID a Guid? (nullable Guid) your code should
work.
--
Happy Coding!
Morten Wennevik [C# MVP]
I see. I think I will let it this way because it is generated by Linq
To SQL dbml and I prefer to touch the least possible in the generated
code.
On Sep 8, 6:22*am, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
shapper <mdmo...@gmail.comwrote:
Well, I can do this:
Guid id = new Guid();
And yet the Guid value is not defined.
Yes it is. That's a well-defined Guid of all zeroes. It's sort of like
the empty string of Guids.
--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon.skeet
C# in Depth:http://csharpindepth.com
You are completely right!
Thanks,
Miguel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Louis Frolio |
last post by:
Greetings All, I have read many upon many articles here regarding GUID
data types and uniqueness. There have been many opinions regarding
the effectiveness of GUID's and when they should/should...
|
by: Jim Heavey |
last post by:
When I use the new(Guid), the GUID which is generated is all zeros. Is
there a technique for the system to assign a real Guid? Do I have to
manually calculate a GUID?
|
by: Rene |
last post by:
I am using the Guid.Empty value ("00000000-0000-0000-0000-000000000000") to
represent a special meaning. The problem is that I don't know if there is a
chance that a command like...
|
by: Nak |
last post by:
Hi there,
Does anyone know how I would get the value of the assembly GUID in code
from within the same application? Thanks in advance.
Nick.
--...
|
by: rcolby |
last post by:
Evening,
Wondering if someone can point me in the right direction, on how I would
compare a system.guid with a system.byte.
system.guid (pulled from sql server table with a data type of...
|
by: George |
last post by:
I want to create a unique id for each of a set of objects.
These ids may be generated on multiple machines simultaneously and must all
be different to each other.
There are an undefined number...
|
by: Wolf |
last post by:
Hi
I am trying to set a property(PartyHomeAddressID) = to a guid in a ini
file.
But everytime when the ini file has an empty guid it breaks with an
error tellin me a guid is 32 char long with 4...
|
by: Michael Primeaux |
last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single
web method with the following signature:
void HelloWorld(Guid parameter1);
When calling this method I receive the...
|
by: Troll |
last post by:
Windows XP Pro
VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.)
I'm using C# to build a custom RSS generator. I'm having trouble building the guid...
|
by: Marc |
last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint
Table1 contains a field Id which is a GUID as primary key and DATA a string,
I want to insert a new row but it does not...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |