| DataView - Integer Sorting |
|
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- 2
- Visual C#.Net >> MDSN Library Download QuestionMSDN Library (April 2007 Edition) MSDN Library (April 2007 Edition) can be
downloaded. One is supposed to use the setup on disk #1, but the downloaded
file cannot be opened. Anybody got the solution?
Adrian.
- 3
- 4
- Microsoft Project >> Project 2003 crashing when saving.Hi Guys,
After installing project 2003 sp1, the program intermitently
crashes when saving projects. It does not do this every time but it does do
it often.
I am not using a project server, project does not report any errors(even in
the event log) it just crashes and then i have to reboot because i cant kill
the process.
Any help is appreciated.
Gareth
- 5
- Dotnet >> >> Web Service vs MS Message QueueHi, I'm new to dot Net.
When would I use MS Message Queue rather than Web Service?
The situation is this... The data source is a remote application.
Periodically (perhaps once an hour) this application will send to our
application data in XML format.
At this stage it is envisaged that there is only one data source. However,
there is discussion that at a later date there may be more than one remote
data source.
Any ideas or recommendations appreciated :-)
Thanks
Jonathan
- 6
- Visual C#.Net >> Count the number of hidden files and directoriesIs there a way to determine the number of hidden files/directories within a
directory? This is what Iâ??m doing now:
System.IO.DirectoryInfo rootPath;
System.IO.FileSystemInfo[] dirs, files;
int numOfDirs = 0, numOfFiles = 0;
di = new System.IO.DirectoryInfo(â??blahâ??);
dirs = rootPath.GetDirectories();
files = rootPath.GetFiles();
for (int i=0; i<dirs.Length; i++)
numOfDirs += ((dirs[i].Attributes & System.IO.FileAttributes.Hidden) ==
System.IO.FileAttributes.Hidden) ? 0 : 1;
for (int i=0; i<files.Length; i++)
numOfFiles += ((files[i].Attributes & System.IO.FileAttributes.Hidden) ==
System.IO.FileAttributes.Hidden) ? 0 : 1;
It seems like there must be a better way?
This canâ??t be very efficient.
Thanks,
Dale
- 7
- 8
- Winforms >> MSDE & Auto IncrementHiya all,
I'm not exactly sure where to be posting this question, but here goes &
hopefully someone can answer it or re-direct me.
I'm building a windows form application in C#. I am using MSDE I've imported
my Access.mdb & set up the Identity, Identity Seed, & Identity Increment. I
want to be able to add a new entries (rows), but the problem arises because
update won't work until I input a number or update my ID field first. I
don't want to see this ID field on my form that is being incremented or to
have the user deal with inputting this number. When I manually (directly) go
in and add data to my field, the ID field does not update till I insert text
into the next row (another new row) following it. This problem does not
happen when I directly access access.mdb itself.
The following is a sample of my code which seems to be correct as does my
Identity, Identity Seed, & Identity Increment :
DataRow thisRow = dsAddError1.Tables["Error Log"].NewRow();
dsAddError1.Tables["Error Log"].Rows.Add(thisRow);
sqlDataAdapter1.Update(dsAddError1, "Error Log");
Any and all suggestions tips are appreciated. Thank you all in advance.
MikeY
- 9
- Dotnet >> Process.StartInfo.EnvironmentVariables problem when there are twoexample code:
public class envtest
{
public static void Main()
{
System.Diagnostics.Process proc =
System.Diagnostics.Process.GetCurrentProcess();
string env = proc.StartInfo.EnvironmentVariables["test"];
}
}
when I compile that code to envtest.exe
and before running it set some env variables that differs only in letter
scope, i.e.
set test=1
set Test=1
I recieve following exception.
Unhandled Exception: System.ArgumentException: Item has already been
added. Key in dictionary: "test" Key being added:
"test"
at System.Collections.Hashtable.Insert(Object key, Object nvalue,
Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at System.Collections.Specialized.StringDictionary.Add(String key,
String value)
at System.Diagnostics.ProcessStartInfo.get_EnvironmentVariables()
at env.Main()
Unknown signal 79
I can catch it but I still cannot get variables value :(
Any idea how to handle that ?
Szymek
- 10
- Visual C#.Net >> Persisting Application Scoped SettingsWhat what I have read, Application Scoped settings in the setting file
are read only. Why is this? Is there a good reason for this
restriction?
I understand that some settings will be different for each user of the
app, hence the User Scoped settings. User scoped settings can be
changed and persisted at runtime.
But there are also settings that are not User Scoped (i. e.
Application Scoped) that still might need to be changed at runtime,
yet this is not possible. Why? Again, is there some good technical
reason for this restriction?
What alternatives are available to me to be able to persist
Application Scoped settings?
Thanks,
Chris
- 11
- Visual C#.Net >> Providing a programming interface to a pluginI was quite surprised to find virtually nothing about this but I may
have been searching for the wrong thing.
I want to know the best way to provide a programming interface to a
plugin. I already have a plugin architecture that allows the
application to call code in a plugin but I want the plugin to also be
able to call code in the application.
I can think of many ways to do this but I am not sure the best way:
Option 1:
The plugin inherits a class that has one function called
GetInterface(), This returns a reference that can be cast to different
Interface types.
Option 2:
The plugin is passed a reference to the application interface which
contains all the callable functions.
Option 3:
The plugin can create an object that has all the API functions in it
e.g. Stop, Pause and Play. (The problem with this is how do you
actually connect those functions back to the main application.) I
suppose this would be similar to the office api or activeX interfaces.
I want to choose the best way that will also allow me to update the
API without breaking any existing plugins.
Any advice is welcomed!
- 12
- Net Framework >> Problem about FindNextPrinterChangeNotificationDear ALL:
I'm writing a program about printer by C# now.I have read Duncan's
article about monitor printer by VB before and followed his method. I use
FindFirstPrinterChangeNotification and FindNextPrinterChangeNotification API
to monitor printer.
Now I'm puzzled by the FindNextPrinterChangeNotification function
.Whenever I call this method to get a pointer of PRINTER_NOTIFY_INFO , it
always return null.
My code is:
int phand;
int whand;
RegisteredWaitHandle rwh;
ManualResetEvent wh;
OpenPrinter("MicrosoftOffice",ref phand, 0) ; //MicrosoftOffice is my
printer name
whand =
FindFirstPrinterChangeNotification(phand,(int)PrinterChangeNotificationGener
alFlags.PRINTER_CHANGE_JOB,0,0);
wh = new ManualResetEvent(false);
wh.Handle = new IntPtr(whand);
rwh = ThreadPool.RegisterWaitForSingleObject(wh,new
WaitOrTimerCallback(PrinterNotifyWaitCallBack),wh,-1,true);
public void PrinterNotifyWaitCallBack(object state,bool timeout)
{
int pdwChange=0;
IntPtr ptr= IntPtr.Zero;
bool next = FindNextPrinterChangeNotification(whand,ref pdwChange,0,ref
ptr); //The next is true,but the ptr always returns 0
PRINTER_NOTIFY_INFO pni =
(PRINTER_NOTIFY_INFO)Marshal.PtrToStructure(ptr,typeof(PRINTER_NOTIFY_INFO))
; //So the pni is always null.
FreePrinterNotifyInfo(ptr);
MessageBox.Show("Notify");
wh.Reset();
rwh = ThreadPool.RegisterWaitForSingleObject(wh,new
WaitOrTimerCallback(PrinterNotifyWaitCallBack),wh,-1,true);
}
I know here are many experts at this field.Could anyone tell me why and
how to solve this problem? I'm crashed by it.
Thank you very much!
- 13
- ADO >> TransactionScope exception handlingIs there any way to have an DataReader.Read part of a TransactionScope but not cancel the transaction if the read fails?
I'm using a DataReader to get the result of a stored procedure which increments a counter. I'd like to add the read to
the transaction only if the read is successful. If the read isn't successful I don't want it to cancel the entire
distributed transaction but I will need to roll it back (since the SP updates a table) if some other part of the transaction fails.
- 14
- Microsoft Project >> Start TimeHow do I start a task say @ 6:00 AM, without putting a
constraint of "Must start On"?
My calendar is set up for a start time of 6:00AM, but as I
schedule a task on that day, it wants to start @ 8:00 AM.
I have set the default for the correct time and calendar.
Thank you,
- 15
- Visual C#.Net >> visual studio problem with comment web pagesHi. I am just running through the hello world tutorial and when I attempt to
generate the comment web pages (like javadoc) it just creates a page with no
content. Um....this is the tutorial and it's really hard to screw this up.
But I managed somehow. My source file is exactly as shown in the book and I
honestly can't see what I could possibly have done wrong, other than some
obscure configuration info somewhere set wrong.
Anyway, if anyone knows what may be amiss, I would appreciate a tip.
Thanks,
--
Jorel
|
| Author |
Message |
topnotchthrillr

|
Posted: Mon Dec 10 23:32:00 PST 2007 |
Top |
Visual C#.Net >> DataView - Integer Sorting
Hi All,
I have used gridview in my application and i m using dataview to sort
the grid. But when i sort the numeric column, dataview sorts it like a
string.
So, after sorting, instead of getting 1,3,11.... i get 1,11,3... in asc
and 3,1,11 in dec..
Anybody has idea regarding this???
Regards,
Mansi Shah.
*** Sent via Developersdex http://www.developersdex.com ***
DotNet201
|
| |
|
| |
 |
MortenWennevik

|
Posted: Mon Dec 10 23:32:00 PST 2007 |
Top |
Visual C#.Net >> DataView - Integer Sorting
Hi,
I'm afraid I can't reproduce your problem. Given that the numeric column is
of a numeric type, the dataview sorts it correctly and I get 1, 3, 11 as
expected.
DataTable dt = new DataTable();
dt.Columns.Add("Strings", typeof(string));
dt.Columns.Add("Numbers", typeof(Int32));
DataRow dr = dt.NewRow();
dr["Strings"] = "One";
dr["Numbers"] = 1;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["Strings"] = "Eleven";
dr["Numbers"] = 11;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["Strings"] = "Three";
dr["Numbers"] = 3;
dt.Rows.Add(dr);
DataView dv = new DataView(dt);
dv.Sort = "Numbers ASC";
grid.DataSource = dv;
--
Happy Coding!
Morten Wennevik [C# MVP]
"Mansi Shah" wrote:
> Hi All,
>
> I have used gridview in my application and i m using dataview to sort
> the grid. But when i sort the numeric column, dataview sorts it like a
> string.
>
> So, after sorting, instead of getting 1,3,11.... i get 1,11,3... in asc
> and 3,1,11 in dec..
>
> Anybody has idea regarding this???
>
> Regards,
> Mansi Shah.
>
> *** Sent via Developersdex http://www.developersdex.com ***
>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- Microsoft Project >> What type of relationship?I am trying to setup a new project and I'm a little stumped about how to
accomplish this. I have an event setup as a milestone, this is a must start
on date. I have many tasks that need to be completed by this date. What is
the easiest way to make sure that all of these tasks are scheduled to be
complete by the milestone date? I have more tasks than will fit in the
predecessor field.
Thanks
- 2
- Microsoft Project >> Windows SharePoint Services and Project 2003Hello,
One of the gold certified partner got the below error
while installing Windows SharePoint Services for Microsoft
Project Server 2003 on Windows 2003.
Error: Share point configuration wizard cannot create the
ms_projectserver_publicdocuments site with the template
you have selected.You must use the project workspace
template or any other template you have created by using
the project workspace template. Ensure that the template
has been installed into the correct directory and that run
share point configuration wizard again.
After a while he wrote the below mail stating the problem
is solved :
Alex,
I made two changes and seem to have resolved the problem.
1. I ran PSCOMPlus.exe and changed the accounts to
domain\administrator - that resolved an error that I got
trying to get WSS Admin COM+ to run properly.
2. When running the sharepoint config utility I added
the domain to the user name (domain\administrator) and ran
the wizard.
One of these two things resolved the problem.
If you could just reply with your observation and view
explaining which option would have solved the problem
could be quite helpful. (Any relevant kb article)
Thank you very much for your help.
Alex Mathew
- 3
- Dotnet >> Content missing from pages - CMS2K2I posted this in the CMS newsgroup and it was suggested that I post it here.
Here's the problem:
I have a problem where an entire page of information disappears from an
intranet website. The website uses Microsoft CMS2K2 and is installed on a W2K
server w/SP4. All other pages on the site are accessible. The event logs show
the following errors:
Event ID: 0
Exception in ActiveDirectoryManager::GetEmployess2(), before
for--System.Runtime.InteropServices.COMException (0x8007203A): The server is
not operational
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.ChildEnumerator..ctor(DirectoryEntry container)
at System.DirectoryServices.DirectoryEntries.GetEnumerator()
at
Mywebsite.IntranetCMS.BusinessServices.ActiveDirectoryManager.BuildEmployees(DirectoryEntry
objTop, ADEmployees objEmployees)
at
MyWebSite.IntranetCMS.BusinessServices.ActiveDirectoryManager.GetEmployees2(ADEmployees
objEmployees)
Event ID: 0
Component: Compaq NIC Management Agent Error: Unable to open the registry
key "%1". Cause: This error can be caused by a corrupt registry or a low
memory condition. Rebooting the server may correct this error.
If I reboot the server or restart the service the data on this page
re-appears but not for long. It's only happening on this one page.
Anyone have any ideas on how to begin troubleshooting this?
TIA
- 4
- Visual C#.Net >> How to share a .csI have write a clss, say DM.cs, and I save it in a independent directory
like c:\MyUtil
I have a new project in c:\proj1.
When I use VS to add the existed c:\MyUtil\DM.cs to the new project, the VS
will copy DM.cs form c:\MyUtil
to c:\proj1.
How can I left the DM.cs in the independent directory ?
- 5
- Microsoft Project >> Connecting to MS Project Server from Windows VistaI am experiencing a problem connecting from MS Vista to Project Server when
the client computer is not on the same domain as the Project Server. This
happens only in Vista.
I am getting the following error:
Project was not able to connect to Project Server Because of the following
error:
Bad Certificate (CERT_REV_FAILED) (ID=0x800a1529)
I tried to find any info on this error but was unsuccessful. Any help would
be greatly greatly appreciated!
Thanks
Yanek
- 6
- Net Framework >> the brotherhoodYes... it is fight for democracy...just fool yourself.....:
http://www.jameswickstrom.com/iraq/photos_show_rape_of_iraqi_women.htm
PS: I can't ignore the brotherhood you american show to the world.....
Shame on you all.
- 7
- 8
- Visual C#.Net >> P/Invoke Problem....Why does the following cause an EntryPointNotFoundException when I do
ExitWindows(0,0); ?
>>>>>>>>>>>>>>
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern bool ExitWindows(ulong dwReserved, uint uReserved);
<<<<<<<<<<<<<<<<<<
- 9
- Visual C#.Net >> changing the defualt languagehello,
i'm wiriting in in C# and my windows is locolized meaning my default
language is not english, but i want that is some textboxes my language will
be english. is it better way to do it then chaging each char to it's english
char on the keyboard (meaning better then catching the event of the
KeyPress/Down/Up check which char is it and replace it)?
thanks
- 10
- Visual C#.Net >> Exception Handling QHi All, my errMsg string never gets initialized when there is an exception.
Can someone explain me why?
Thanks
string errMsg=null;
try
{
MyFunction();
}
catch(Exception e)
{
throw new Exception("Failed in MyFunction",e.InnerException);
errMsg="Some error:
}
return errMsg;
- 11
- 12
- 13
- Net Framework >> LinkDemand ErrorHello,
I have a class that implements the interface IMessageFilter. When I run
FxCop on this class the following error appears:
The virtual method IMessageFilter.PreFilterMessage(Message&):Boolean
defined by type 'System.Windows.Forms. IMessageFilter' and its override
MessageFilter.PreFilterMessage(Message&):Boolean do not have the same
LinkDemand status. Add a LinkDemand where required.
I have placed the folloing code:
[CustomPermissionAttribute(SecurityAction.LinkDemand)] but still have
the same error. I tried with the
[CustomPermissionAttribute(SecurityAction.LinkDemand),
Unrestricted=true] and also with Unrestricted=false but nothing, same
error.
Can someone tell me what I do wrong.
Thank you.
- 14
- Winforms >> Converting a Job into a VB.Net AppHello All
I have a Job which used 2 Stored Procedure and runs on
SQL-Server 2000.I Need to write a Application in VB.Net to
do same work of JOB on a Application Tier instead of SQL-
Server.Any Hints Please.
Thanks
- 15
- Dotnet >> Run RCMD on VB .NET program problemHello all,
I have the urgent problem. Pls help me.
I have written VB .net program to fax PDF document. The program hasn't
screen interface and runs in Command Prompt.
Here is some program segments.
faxserver.connect(LocalComputerName)
faxserver.createdocument("c:\test.pdf")
...
faxserver.send()
That's ok when I run in local computer Win2000 Server.
But, I can't run it remotely. I use RCMD.
RCMD \\ServerName "C:\FaxProgramName Param1 Param2"
There is no error code prompt. I can see the program process in server
computer. I have created and used the same username account both in server
(Win 2K server ) and Remote computer (WinNT WKS) with the administrator
right.
Thanks in Advance.
IVAN CHAN
|
|
|