|
the return type of this method is DBNull, so you can only ever return a null value..
i suspect you don't really need a static method to perform this check, and could probably get away with something like this instead :
if(string.IsNullOrEmpty(strCheckString))<br />
object = DBNull.Value;<br />
else<br />
object = strCheckString;
|
|
|
|
|
I want to put this into a function because I have a 20 checks, and the code can get very long.
Please put the above mentioned code in a function.
|
|
|
|
|
I don't know how well it would work but you could try making your method return Object
|
|
|
|
|
This was how I initially had it, I just thought there might be another way. But thanks for your help, I appreciate it!!
|
|
|
|
|
Hi,
During the last days i strugled around with a strange problem.
I need to play an video on a 3D-Object. That doesnt sound that hard. I created an device as common, added some data to the vertex buffer and activated the texture support of the Video Class:
video.TextureReadyToRender += new TextureRenderEventHandler(video_TextureReadyToRender);<br />
video.RenderToTexture(device);
Immediatly after the RenderToTexture call, the TextureReadyToRender Event was fired and I was able to render my desired scene. So far so goo, no problems at all. It works absolut perfectly
But when I want to close my application I'm not able to clean up. Everytime when me (or the framework) wants to call the Dispose() method, an NullReferenceException is throwed.
I googled around a lot but couldn't find an answer. Does someone know perhaps an easy example? I tried to work with the Example from MDX-SDK(Summer2004), but because of the complicated framework structure I wasn't able to figure out too much. Does anyone have the same problem?
|
|
|
|
|
Hi all,
I want to know how can i encrypt the whole XML file, it means that the data inside this file can't be understood with any user if he try to open this file (Ex.112364896fgdf64965)
if anyone know please help me
|
|
|
|
|
Take a look at the System.Security.Cryptography namespace.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
i saw this namespace and i didn't found what i want , it makes only encryption for XMLElements and i want to incrypt the whole file to be in octet stream
Thanks for your help
|
|
|
|
|
There is no special method for encrypting an xml document. Just get the xml document as a string, and encrypt it.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks alot for your help
|
|
|
|
|
i am working with c# console application.i am using MInternetExplorer.Explorer class of SHocVw.dll.basically i am parsing html pages.i am using following events as per my requirement
BeforeNavigate2()
DocumentComplete()
i would like to resolve the IP address of website.i used the following code for resolving IP Address
IPHostEntry IPHost =Dns.Resolve("http://www.yahoo.com");
// after that code is not executing
IPAddress[] addr=IPHost.AddressList;
for(int i= 0; i
|
|
|
|
|
Amit_CDAC_Grover wrote: Dns.Resolve("http://www.yahoo.com");
Hostnames do not include the http:// part.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
i have also tried with Dns.Resolve("www.yahoo.com") but that is also not working.
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
This code runs fine on my machine
IPHostEntry entry = Dns.Resolve("www.google.com");
Console.WriteLine(entry.AddressList[0].ToString());
Does your computer have a DNS server configured? When you ping www.yahoo.com, do you see the IP Address in the response?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
no i don'nt have DNS server configured on my system. what should i do in order to configure DNS server
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
Amit_CDAC_Grover wrote: no i don'nt have DNS server configured on my system.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
Open a CMD prompt and type ipconfig /all and see what you get. Down near the bottom of what comes up, it should list at least one DNS Server IP address.
Any DNS setup information has to come from your ISP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am working on a project in which i'm dealing with business layer and data layer where business layer has a reference of data layer. when business layer call a function of data layer sending ref object variable as parameter
function signature in data layer is:
"public bool add(ref object objagent)"
this ref object variable is actually an instance of business layer class,
but when i proceed with function assigning values like:
string stragentname;
stragentname=objagent.agentname;
upon complilation it gives me error:"object doesnot contain a definition for agentname"
|
|
|
|
|
That's because you are passing the thing as an object, instead of whatever type it really is. Your method signature should probably be something like this:
public bool Add( Agent agent )
{
string agentName = agent.agentName;
...
}
From what you've shown, there is no need to have the ref keyword in there.
Also, you don't need Hungarian notation with C#.
Matt Gerrans
|
|
|
|
|
thanks Matt
but i can not declare Agent type in this function, because it is defined in data layer that do not have reference of business layer. therefore, i have to declare object type.
|
|
|
|
|
If you can't reference the class, then you can't do anything with it (unless you use reflection).
If you don't want the data layer to know the business class, then make an interface with the properties you want to expose, and make the business class implement it, and reference the interface in the data layer.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa's suggestion is probably the way you should go.
Another quick-and-dirty option, if Add() only needs a few things, is to use parameters. For example:
Add( string agentName, int agentId );
Another one that's even more of a hack is to pass an attribute/value Hashtable.
Matt Gerrans
|
|
|
|
|
i am just starting out with using microsoft visual c# and have made a browser window to use as a client for a web based game everything works as expected besides one thing....
when you click the play button for the game... it opens a new window... i am looking for a simple way to over ride this and make it open in the program window.... if i right click the link and click open link it opens the way i want it to....
but i think the developers have embedded the code into the page causing it to open in a new window....
if anyone would be willing to help me i have msn at voxcustoms@hotmail.com and i can send you the project... i would appreciate any and all help i could get.... i am starting to get discouraged with this... i have looked at about 100 different pages and havent been able to find it on the web since i have no idea what most of it is talking about....
thank you in advance....
Nathan
|
|
|
|
|
Hello There,
I am working with c# & I have used two textbox server control.
1> Registration Date
2> Expiry Date
First of all, user enters value for the first textbox namely Registration Date and then the expiry date should be auto calculated by adding 30 days into currently entered registration date when he user leaves the first textbox.
That means there are two textboxes - user enters the value for first textbox and the second textbox should be auto calcuated on lost focus event of first textbox.
So pls let me know..... Waiting for your answer....
Thanks,
Paresh
|
|
|
|
|
textbox2.Text = DateTime.Parse(textbox1.Text).AddDays(30).ToString();
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|