|
Hi,
how to pass a "IS NOT NULL" to an OleDbParameter?
I know how to do "IS NULL":
parameter = new OleDbParameter(myField, Convert.DBNull);
Any Help would be great...
Thank's
:k:
|
|
|
|
|
|
You can pass in an actual Null value for the parameter using your code, but this doesn't mean you're passing "IS NULL" or "IS NOT NULL". These aren't values, they're conditions, presumably your stored procedure or query would then use IS NULL or IS NOT NULL to check whether or not the value you passed in was or was not a Null.
|
|
|
|
|
How do .net framework relates to ajax technology.
|
|
|
|
|
sapna sangole wrote: How do .net framework relates to ajax technology.
They are both code.
Please clarify what you are asking - are you asking how do you implement AJAX in the .NET framework, or are you asking what AJAX is, and how it differs from the .NET framework?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
You can use AJAX with .Net framework in 2 ways
1. Use asynchronous Javascript method call to find server function and write everything by you only by you.
2. Or Install free Microsoft AJAX Framework and take advantage of AJAX Control Toolkit.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
Hi Guys,
I've got a little wrapper class that exposes some registry properties in my code. This works and passes the unit test for writing and reading the value and comparing the result. However, when i look in the registry, there's no section for the values i am manipulating.
public static void SetGroupRegInfo(string group, string key, string value)
{
RegistryKey rkApp = Registry.LocalMachine.CreateSubKey(
REGISTRY_MICA_GROUPS + "\\" + group,
RegistryKeyPermissionCheck.ReadWriteSubTree);
try
{
rkApp.SetValue(key, value);
}
finally
{
rkApp.Close();
}
}
public static string GetGroupRegInfo(string group, string key)
{
RegistryKey rkApp = Registry.LocalMachine.OpenSubKey(
REGISTRY_MICA_GROUPS + "\\" + group,
RegistryKeyPermissionCheck.ReadSubTree,
RegistryRights.QueryValues);
if (rkApp == null)
return null;
try
{
return (string)rkApp.GetValue(key);
}
finally
{
rkApp.Close();
}
}
The base registry entries are created correctly by the application installer, but these values just don't seem to appear.
Any thoughts?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
I find your post confusing. You say the Unit Tests pass but we have no idea what is being tested. You say "it works" but the value is not in the registry so I have no idea what "it works" means because to me if the value is not written to the registry then I would say it is NOT working.
|
|
|
|
|
can't stay away for more than 8 minutes, can you?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: can't stay away for more than 8 minutes, can you?
Hey Luc,
See here[^]
and here[^]
So long dude.
|
|
|
|
|
Exactly, that[^] and your above message are 8 minutes apart.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: and your above message are 8 minutes apart.
That time is the original post, I modified it twice, see where I say "I just changed my mind".
|
|
|
|
|
I see. I never mind the "modified at..." message that gets added automatically, it uses Bujumbura local time or something similar, doesn't tell me much.
In the mean time, you're still here. Which is great.
BTW: if and when the new be-really-kind rules would really cripple you, you can always put a leaded answer in one of the soapboxes/back rooms, and just reply with a link to it.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Well, "it works" would mean that the unit test does the following:
* Write a value to the registry via the wrapper
* Read a value from the registry via the wrapper
* Assert that the value read is equal to the value written
So the fact that these values don't appear in the registry confuses me too and I'm inclined to agree that it appears to be not working, hence i posted here. :P
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi,
I would guess you're running on Vista or higher, which virtualizes all registry hives but current_user when running below elevated admin level, whereas your installer (and your unit tests?) probably runs as elevated admin and creates and uses the proper keys.
A regular user is not supposed to modify local_machine keys, since they extend beyond his realm.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Yes, I'm on vista.
What effect will this have if i shutdown and re-start? Does the registry for my local machine get burned?
Is there any way around this without admin rights?
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: without admin rights?
use current_user.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Hello Mahesh,
Before I forget, "waana" is not an english word.
ksss_maheshece wrote: include that file in my webfrom
Not sure what that means but perhaps you want to have an XML Data Island.
|
|
|
|
|
led mike wrote: Not sure what that means but perhaps you want to have an XML Data Island.
Shouldn't that be "waana have an XML Data Island"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What up!
Hey while I have your attention, what's the deal with the HOW TO ANSWER A QUESTION? Does it mean the monkeys have taken control of this site and I am no longer welcome?
|
|
|
|
|
led mike wrote: what's the deal with the HOW TO ANSWER A QUESTION?
Beats me. I voted to have it removed
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I voted to have it removed
No you didn't, in this forum anyway. I just did!
So I guess I'll see how it goes but I may have to stop using CP because I'm not inclined to put up with any monkeyshit.
No I just changed my mind, stuff it, I'm outahere. Good luck dude, it's been fun.
modified on Wednesday, July 22, 2009 12:58 PM
|
|
|
|
|
Hi,
I use the XmlSerializer and I'm looking for a way to set the default XML namespace on the top level Element. The correct way to do this, I hoped, was to specify this in an XmlType attribibute on the top level class. However, the namespace is only applied to the children of this class. For example, see the C# code below that serializes a simple nested structure:
public class Circle
{
}
[XmlType(Namespace="http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
public class SerializeTest
{
public static void Serialize()
{
Shapes shapes = new Shapes();
using (TextWriter textWriter = new StreamWriter("Shapes.xml"))
{
XmlSerializer xmlSerializer = new XmlSerializer(typeof(Shapes));
xmlSerializer.Serialize(textWriter, shapes);
}
}
}
The output is this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Circle xmlns="http://mbshapes.com" />
</Shapes>
What I expected (and what I need), is something like this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mbshapes.com">
<Circle />
</Shapes>
Am I doing something wrong? Or are there any work-arounds?
Thanks.
|
|
|
|
|
Try
[<code>XmlRoot</code>(Namespace = "http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|