|
nope that workes perfectly
thanks for your help
|
|
|
|
|
Hi,
I have DataGridView in my application connecting to Oracle DB. Oracle table has a date as '03/12/2007' and same is returned to the front end via DataSet. However when this dataset is bound to the grid, the date displayed is '03/11/2007'!!! Similarly all the dates that have two (2) digit days (from 10 to 31) are reduced by a digit! e.g. instead of '03/30/2007' it shows '03/29/2007'. If I do not use any formatting for the .DefaultCellStyle property then the date displayed is '03/11/2007 11:00 PM'. Dates with single digit days i.e. '03/08/2007' stays the same though - with or without formatting. Please note that my SQL statement truncates the date to short date format - TRUNC(pay_date) - already.
Any help is really appreciated.
Thanks.
crzYank
|
|
|
|
|
You could try and just use text straight from Oracle and use it as string. If you are using a strong typeing thi might not be possible.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
That should work. I'll try that.
Thanks!
crzYank
|
|
|
|
|
and it worked...........
crzYank
|
|
|
|
|
I have a need to change the Regional And Language Settings/Locale through my C# Application. To further Complicate the matter, it will need to be done using Win CE 5.0 operating system. I have Visual Studio 2005.
Anyone have any suggestions?
Thanks
|
|
|
|
|
|
Thanks for the response. I am doing this project with the Compact framework.
I am not sure how this will help me set the Control Panel -> Regional Settings for different Languages->Cultures using C#/C++.
I Would also be ok with finding a DLL that I could connect to, to use some method within that would help me set the regional values.
|
|
|
|
|
i have an IP and i want to change it to host name
how is that??
thanks allot
|
|
|
|
|
In your help look up Dns.GetHostEntry().
Phil
|
|
|
|
|
GetHostEntry Resolves a host name or IP address to an IPHostEntry instance.
but i have an IP as a string and i need to resolve it to host name as a string too.
thanks allot
|
|
|
|
|
Dns.GetHostByAddress("127.0.0.1").HostName
Hope this help.
Neo
|
|
|
|
|
thanks allot. it works
best regards.
|
|
|
|
|
Hi,
when i run this code i get a null-reference exception at the last line of code. I don't know why this happens, because i first add the node and it IS there. I looked in the debugger.
Does someone know a solution?
<code>
foreach (DateTime d in daten)
{
if (treeView1.Nodes.Find(d.Month.ToString(), false) != null)
{
treeView1.Nodes.Add(new TreeNode(d.Month.ToString()));
}
treeView1.Nodes[d.Month.ToString()].Nodes.Add(new TreeNode(d.Date.ToShortDateString()));
}
</code>
|
|
|
|
|
It will be easier to see what's going on if you break out that last line of code as follows:
TreeNode node = treeView1.Nodes[d.Month.ToString()];
TreeNode newNode = new TreeNode(d.Date.ToShortDateString());
node.Nodes.Add(newNode);
This will allow you to check state as you step though in debug mode. When you put so much into a single line, it can be much less obvious what is breaking.
|
|
|
|
|
if d is null from daten then d.Month will fail;
Also, treeView1.Notes[someString] may return null as well but it is most likely the d;
File Not Found
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: but it is most likely the d
Not so very likely... The variable d is a DateTime structure, and can't be null.
---
single minded; short sighted; long gone;
|
|
|
|
|
Since daten is not defined in could very well be a non-generic 1.1 .NET collection such as an array list which are collections of objects. Iterating on such a structure would attempt to assign null giving the null reference exception. Below is written in 2.0 but uses the 1.1 collection ArrayList.
<br />
ArrayList list = new ArrayList();<br />
list.Add(DateTime.Now);<br />
list.Add(null);<br />
foreach(DateTime d in list) {<br />
MessageBox.Show(d.ToShortDateString());<br />
}<br />
File Not Found
|
|
|
|
|
No, it couldn't. If the daten collection would contain something other than DateTime values, the error would appear when the value is put in the d variable, not when the d variable is later used.
---
single minded; short sighted; long gone;
|
|
|
|
|
Perhaps but when a question is posed so vague as to say where is my null reference exception i think any little bit of help will help.
Now you are correct in that when I said d.Month I was wrong. Sometimes I say the stupidest things. Of course, that could also fall into the category of someone designing an OO language that doesn't fully support nulls until the third release.
File Not Found
|
|
|
|
|
Can anyone tell me how to use this control? Help me please...
public ListViewItem ( string[] items , System.Int32 imageIndex , System.Drawing.Color foreColor , System.Drawing.Color backColor , System.Drawing.Font font )
|
|
|
|
|
You'll really need to ask a more specific question. The ListView control can be used lots of ways. What exactly are you trying to do?
Also, have you tried reading the ?
documentation on MSDN[^]
|
|
|
|
|
I want to do drag and drop in list view.But from what i seen, drag and drop can be done for string only. Can we do drag and drop other than string?
|
|
|
|
|
shamsteady wrote: from what i seen, drag and drop can be done for string only
I'm not sure what you mean. ListView controls don't contain strings, they contain ListViewItem objects.
It is fairly simple to implement Drag/Drop behavior in a ListView. You'll need to create a new control that inherits from ListView, then override the drag/drop event handlers. This article[^]appears to explain it (I didn't read it myself...).
Good luck.
|
|
|
|
|