|
Double check that the field ID2 does allow null values, that make sure that there isn't a exception thrown if there is a null value. Additionally, in your code, you can check the value before passing it, and if it is equal to DBNull then set the value to 0 instead of null.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Found something :
[^]
i need to check each field for null and pass null value myself. Seems very unlogic to me knowning that SQL servers allow DBnull values in tables.
Ex :
<br />
if(Table1Row.IsID2Null())<br />
ATDatabase.AddInParameter(updateCommand, "ID2", DbType.Int32, null);<br />
else<br />
ATDatabase.AddInParameter(updateCommand, "ID2", DbType.Int32, Table1Row.ID2);
Checking the auto generated code from the typed dataset:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]<br />
public long ID2 {<br />
get {<br />
try {<br />
return ((long)(this[this.Table1.ID2Column]));<br />
}<br />
catch (System.InvalidCastException e) {<br />
throw new System.Data.StrongTypingException("The value for column \'ID2\' in table \'Table1\' is DBNull.", e);<br />
}<br />
}<br />
set {<br />
this[this.Table1.ID2Column] = value;<br />
}<br />
}
Cannot pass null value here...
greetz
Kurt
|
|
|
|
|
IIRC a typed dataset generates 2 methods for you:
IsColumnNameNull()
SetColumnNameNull()
|
|
|
|
|
hello,
I'm working on a C# windows application. I've managed a connection with an MS Access Db, but I'm having a problem with retrieving a single cell from a table.
Can someone please post a sample statement of retrieving and converting it to string?
Thanks in advance.
|
|
|
|
|
Have a look into this simple example
Example[^]
|
|
|
|
|
Create a DataTable . Once you have established a connection, use a TableAdapter to fill the DataTable . Once you have done that, it's as simple as getting the data from a DataTable .
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I've embedded a webbrowser control in a 3rd part application via their plug-in mechanism
The first time I set the documentText property on the webbrowser control nothing happens. The documentText property remains as "/0" and the browser doesn't update. On subsequent attempts when i set the value it works just fine, all updating occurs via the same code.
I found a single posting where someone was experiencing the same issues but no one had much advice.
Has anyone seen this behaviour before?
Thanks
Russell
|
|
|
|
|
Russell Jones wrote: Has anyone seen this behaviour before?
Maybe. Try this rather than setting the documentText property:
browserCtrl.Navigate("about:blank");
led mike
|
|
|
|
|
Thanks mike,
That was one of the things i tried while getting this thing to work. There were a few people who reported that until the page navigated somewhere you couldn't set the document text property. I'd forgotten about that.
At least i now understand that the documenttext won't show the text you set it to until that text is loaded up in the browser so it makes sense that it would still be blank.
Is there a way to force the browser to render the text it's been given?
Russell
|
|
|
|
|
Russell Jones wrote: Is there a way to force the browser to render the text it's been given?
Not exactly sure what you mean by that but this has been working for me for several years now
browserCtrl.Navigate("about:blank");
string sHtml = "<html><body>No Document</body></html>";
Document.Write(sHtml);
This is in a User Control where also:
public HtmlDocument Document { get { return browserCtrl.Document; } }
led mike
|
|
|
|
|
Hello friends
I need help , can anybody help me for geting all child nodes from perticular node. like eg.
<rss version="2.0">
<channel>
<title>Suchbegriffe von Herzel
http://www.andunite.com<description>andUNITE - Suchbegriffe von Herzel
<pubdate> Tue, 5 Feb 2008 12:44:54 GMT
<item>
<title>herz
<description>herz
http://beta.andunite.com/EnterWorkspace.do?type=Searchword§ion=home¶m=6759 <pubdate>10 Jan 2008 09:47:08 GMT
<item>
<title>herz
<description>herz
http://beta.andunite.com/EnterWorkspace.do?type=Searchword§ion=home¶m=6759 <pubdate>10 Jan 2008 09:47:08 GMT
from above file , i want all child node of every item parent node .
can anybody helpe me ??
thanking you advance
regards
ashok
|
|
|
|
|
You have an example on MSDN[^]
SkyWalker
|
|
|
|
|
hi,
I am using vlc 0.8.6d to connect Axis 210 camera when enabling
"anonymous viewer" in the camera interface the rtsp request given below is working fine
The rtsp request is :
rtsp://user:pwd@192.168.1.111:554/mpeg4/media.amp
but i need a rtsp request without enabling "Anonymous viewer in the camera interface
Does anybody know how to pass user-id and password to start an rtsp session with basic authentication?
cheers........princy
|
|
|
|
|
Plz give me idea about how to run Multiple command in MS_DOS using C Sharp code.
for eg. using command prompt: telenet 10.0.1.15
login : snt
password : snt
execute more commands....
i use
System.Diagnostics.Process.Start ("cmd", @"/c telnet 10.0.1.15");
but how to again fire command for login, password and more...
|
|
|
|
|
I don't think you're going to be able to do it using Process.Start as you're simply launching another process - you need to have your own to send messages and listen for events etc.
For telnet, have a look at this[^]. I haven't tried it but it's open source so it should give you an idea at least by examining the source.
|
|
|
|
|
How to write code or Upload a file in c#
Thankyou,
Kalyan.
|
|
|
|
|
kalyan1211 wrote: How to write code or Upload a file in c#
What you are trying to do ?
|
|
|
|
|
Hi guys!
I need your input on how to solve a problem that we have.
Our company provides a web-service, a SaaS.
Our idea is to create a destop appilication that can communicate with the web service using https.
I have written a .net app in C#, and I need ideas on how I can login a user without the user needing to type his username and password each time.
The idea is that the user inputs his username and password once and then checks the checkbox to automatically login. Now the user doesn't need to input his login details each time the program restarts. My criteria is that the client should never store the password (clear-text or encrypted) on the local machine.
This is my idea for a solution.
User input the username and password on the desktop-client
The client sends the login details to the webserver, over ssl.
The server verifies the login details and sends back a challenge to the client, if the username and password was correct.
The client then computes a static value using DAPI. This is how i do it:
Code Snippet
private static RSA GetKey(DataProtectionScope scope)
{
switch (scope)
{
case DataProtectionScope.CurrentUser:
if (user == null)
{
CspParameters csp = new CspParameters();
csp.KeyContainerName = "DAPI";
user = new RSACryptoServiceProvider(1536, csp);
}
return user;
default:
throw new CryptographicException("Invalid scope.");
}
}
RSA rsaKey = GetKey(DataProtectionScope.CurrentUser);
RSAParameters keyParam = rsaKey.ExportParameters(true);
Then I use keyParam.P, which is the private key as the static value.
And this static value is dependent on the current user that is loged in to the OS.
I use the static value and the challenged recieved from the server to compute a hash value, H(keyParam.P, challenge).
The client send this value back to the server, and the server will use this hash value in future authentication.
So from now on, the client needs to compute this hash value on runtime, each time he wants to access the webservice.
I think this is strong enough for authentication. But the only problem I see with this solution is that the server has no idea what application is communicating with it. I want from the server only allow application signed or certified by us to contact the server. Because, the problem I see is that, an attacker can create an imitation of my destop client and fetch information from the server, if the user chooses to use "automatic login" feature.
I hope you guys understand my problem. Any replies will be deeply appreciated!
Thank,
/SC
modified on Wednesday, February 06, 2008 5:50:18 AM
|
|
|
|
|
while geeting this.ActiveMDIChild windows return as Form. I need as the original class object. there is any way? thanks in advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
Try this.ActiveMdiChild.GetType()
|
|
|
|
|
hi,
What is the replacement of InputBox function (VB.Net) in C#.Net?
I.e in VB.Net we have InputBox function to allow user for entering details..similarly is there any function in C#.Net?
|
|
|
|
|
Google "c# inputbox" = Clickety
You always pass failure on the way to success.
|
|
|
|
|
Hi,
we can use Microsoft.VisualBasic.dll as reference in your c# application
and then use the following line in your code
Microsoft.VisualBasic.Intereaction.InputBox("entervalues","values","null",0,0);
where enter values is the prompt message for the user ,
values is the title of the input box,
null is the default value
0,0 are the x and y coordinates of the position of input box.
-Suchi
|
|
|
|
|
Suchi Teegala wrote: 0,0
These are actually optional arguments in VB.NET. But since C# does not support the concept of optional arguments, we ought to provide a value explicitly.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
ya deepak but we can directly enter the values as 0,0
can u tell me if there is any problem in writing in that
particular way?
|
|
|
|