| Using IComparer to Sort a String Array |
|
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- Visual C#.Net >> Using ResXFileCodeGeneratorEx with VCS Express 2005I'm using Visual C# Express 2005.
I installed ResXFileCodeGeneratorEx from
http://dmytro.kryvko.googlepages.com
and set it as Custom Tool for my resx file.
Trying to run by selecting "Run Custom Tool" causes error
---------------------------
Microsoft Visual C# 2005 Express Edition
---------------------------
Cannot find custom tool 'ResXFileCodeGeneratorEx' on this system.
---------------------------
OK
---------------------------
How to fix ?
Andrus.
- 2
- Winforms >> Window Forms and panelsShould anything even a menu, toolbar or statusbar ever be directly placed on
the main window or should they always be placed on a container such as a
panel?
Bill
- 3
- Visual C#.Net >> How to make a custom template for my project?Hello there,
I want to ask you guys how to make template for my own project in visual
studio 2005 preferable in c#? Is it very easy to implement ? Need tutorial
for this...
I've seen in the net a few articles about this but i did not understand.
Can anyone tell me how to create this please?
Thanks
Ryza
- 4
- ADO >> Truncate function???Does anybody know if there is a similiar function in MS
Access like the ORACLE "TRUNCATE" function?
eg:
trunc(RSS_TRACKING.COMPLETION_DATE) AS COMPLETION_DATE
result is: 6/29/03
The truncate function basically will aggregate dates
(which I have in my GROUP BY clause) based off of a
common starting point, like every Sunday, for instance.
I tried using ROUND, but it seems only for numbers, not
dates. I also tried using the CONVERT and CAST functions
in addition to the ROUND function, but still couldn't do
the date conversion.
Thanks,
Bill.......
- 5
- 6
- Dotnet >> Bind datatable to excel worksheetIt is possible bind a memory AdoNet Datatable to an Excel wooksheet and,
after update of datatable contens (via code), view update in real time on
the woorksheet?
I am starting use Visual studio tool for office to make this task: it is the
correct way?
thank's in advance for help
gianni
- 7
- Microsoft Project >> Default workflow of tomesheets and task updatesHi i'm Prasanth,
I would like to know default workflow of task updates and timesheets of
Projectserver 2007 from perspective of project manager and team member.
When a Project manager assigns a
task to team member he is not able to see the tasks under mytasks but can see
them under mytimesheet.Many small organisations have only one manager who
approves both timesheets and task updates of team members.How can i achieve
this in project server 2007 as in project server 2003.
- 8
- Net Framework >> Looking For An Example Of Replacing Only One Occurrence In A StringDoes anyone have an example of replacing only one occurrence of a
substring in a string. I have tried replace, but it replaces all
occurrences of the new string in the string. I only want to replace
the specified occurrence in the string (i.e substring(37, 10) - phone
number) with a new phone number. Am I making any sense here or do I
need to provide more detail ?
- 9
- Dotnet >> How to hide a object's inherited properties ?I create a user control object and show its properties through a propertygrid
object in my application. It is sure that there are 100 hundred of properties
inherited from System.Windows.Forms.UserControl and they are all showed on
the propertygrid. Is there a way i can hide all these inherited properties
and show only my user control's properties ?
- 10
- Visual C#.Net >> Setup Project Prereq'sI am building a Setup Project in Visual Studio 2008 for a project which only
requires .NET Framework 2.0. When I build the Setup Project and attempt to
utilize the .MSI file created by the Setup Project, the computer complains
that .NET Framework 3.5 is required to run the setup. Can I configure the
Setup Project to be built using .NET Framework 2.0 instead of 3.5? The end
result is that my machines have 2.0 installed and I don't need 3.5 for the
application I am trying to install?
- 11
- Microsoft Project >> how to represent a continuous activity in a project plan?hi,
i have been working on a project plan and wanted to add certain activities
in the plan which are of "continuous" nature. For example, "communication",
"status reporting" are activities that are going to span throughout the
project and according to the plan, they'd consume around 15% effort of the
Project Manager throughout the project alongwith other activities.
For this purpose, I could simply add a task in the plan and assign 15%
resource UNITS to each of them. Since these activies are to be started right
from the very first day of the project, i know the start date, but the end
date of these tasks will actually be the LAST day of the project deadline
since these activities are going to last till the last day. Since, this LAST
day will vary depending on the changes i will be making during the project,
it cannot be fixed. I don't want to manually assign the end date myself, but
would like it to "update" automatically as i make changes to rest of the
plan.
I tried adding dependency of the 1st and last task from the WBS with
following type:
1st Task, Start to Start
Last Task, Finish to Finish
By doing so, i was hoping to tell MS project that this task is going to
start with the 1st Task and End with the Last task. But it didn't work.
Maybe this is not the way to do it. Can someone please help me understand
how to do it?
Thanks!
Akhlaq.
- 12
- Microsoft Project >> Graphical indicator for %complete and durationi want to display graphical indicator depending on the %completion
field value.For instance if the %Completion is less that 50% then the
stoplight should alert with RED.But here i have to consider the
duration(%duration).for instance if %completion is 20% when the
%duration is also 20% then its fine.But if duration% is 80% and
%completion is 30% the we should alert about this.what i need is can we
derive a formula and then based on the value we can display the
Stoplight.That is considering both %complete and duration-completed.
any suggesstions
- 13
- Visual C#.Net >> Media recording and delivery via C#I want to be able to record media off CD's and onto the C: drive, and then
control display - all via the framework.
Is the Media Player SDK ActiveX control the best for this? Or some other
solution?
Thanks,
John
- 14
- Dotnet >> how to get compatibilityHi,
I have some pages an ASP.NET application when i run in IE 5.0/6.0 it is
showing all the controls when i run the same application in different
browser
i.e natescape navigator then it is showing error....
I mean to say there is no browser compatibility in my application how do it
set this..It should display in any browser...
Thanx In advance
Yoshitha
- 15
- Dotnet >> Capturing login event in Service ApplicationI am writing a Windows Service Application and want to be able to capture when the user is logging into Windows. Is there any way within .NET to do this? Basically, I need the equivalent to the SystemEvents.SessionEnded event.
--
Dan S
|
| Author |
Message |
BillSkeggs

|
Posted: Wed Mar 26 07:46:10 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
Hello All,
I stumped and I need some help. I have an unsorted string array that looks
something like:
AA
XXX
Z
and I would like to sort it like:
Z
AA
XXX
or like:
XXX
AA
Z
My research has lead me to using the IComparer interface. What I am having
difficulties with is developing a class that will take an unsorted string
array (as noted above) and return a sorted string array (as noted above)
using the IComparer interface.
Thanks in Advance!
DotNet321
|
| |
|
| |
 |
Marc

|
Posted: Wed Mar 26 07:46:10 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
I'm assuming that "XXX" is some secial value that you want to
highlight?
Anyways... something like below.
Marc
using System;
using System.Collections.Generic;
using System.Collections;
public class XxxComparer : IComparer<string>, IComparer
{
public static readonly IComparer<string> Default = new
XxxComparer();
const string KNOWN_VAL = "XXX";
public int Compare(string lhs, string rhs)
{
if (lhs == KNOWN_VAL)
{
return rhs == KNOWN_VAL ? 0 : -1;
}
else if (rhs == KNOWN_VAL)
{
return 1;
}
return string.Compare(lhs, rhs);
}
int IComparer.Compare(object lhs, object rhs)
{
return Compare(lhs as string, rhs as string);
}
}
static class Program
{
static void Main() {
string[] vals = { "AA", "XXX", "Z" };
Array.Sort<string>(vals, XxxComparer.Default);
foreach (string val in vals)
{
Console.WriteLine(val);
}
}
}
|
| |
|
| |
 |
Ben

|
Posted: Wed Mar 26 08:31:37 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
Jeta wrote:
> Hello All,
>
> I stumped and I need some help. I have an unsorted string array that
> looks something like:
> AA
> XXX
> Z
>
> and I would like to sort it like:
> Z
> AA
> XXX
>
> or like:
> XXX
> AA
> Z
>
> My research has lead me to using the IComparer interface. What I am
> having difficulties with is developing a class that will take an
> unsorted string array (as noted above) and return a sorted string
> array (as noted above) using the IComparer interface.
You probably really want the Comparison(T) delegate, but the List.Sort
method will work with either.
Something like:
int ConvertColumnName(string s)
{
int total = 0;
foreach (char c in s)
total = total * 26 + (c - 'A' + 1);
return total;
}
The for ascending or descending sort:
List<string> l;
l.Sort(delegate (string first, string second) { return
ConvertColumnName(first) - ConvertColumnName(second); });
l.Sort(delegate (string first, string second) { return
ConvertColumnName(second) - ConvertColumnName(first); });
|
| |
|
| |
 |
Jeta

|
Posted: Wed Mar 26 09:19:21 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
Hi Marc,
Thank you for your response!
In the context of your XxxComparer class, "XXX" has no special meaning. In
Main() is where it becomes important (not the XXX, but the highest
letter(s)) All I need is a "comparer" class to return a sorted array. Once
returned, I would like to procure the highest value from the first or last
element of the array. Note, the unsorted string array that I provided was
just a sample. The unsorted sample array could have looked like the
following examples:
example 1
A
B
C
Z
AA
AZ
AC
AB
example 2
ZZX
ZZY
ZZZ
Also, in your code, you have "using System.Collections.Generic;", I think
this was introduced in .Net 2.0, the company that I work for is making me
compile my "stuff" down to .Net 1.1 I mention this because I am not sure if
your technique will work for .Net 1.1
Thanks Again!
"Marc Gravell" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> I'm assuming that "XXX" is some secial value that you want to
> highlight?
>
> Anyways... something like below.
>
> Marc
>
> using System;
> using System.Collections.Generic;
> using System.Collections;
>
> public class XxxComparer : IComparer<string>, IComparer
> {
> public static readonly IComparer<string> Default = new
> XxxComparer();
> const string KNOWN_VAL = "XXX";
> public int Compare(string lhs, string rhs)
> {
> if (lhs == KNOWN_VAL)
> {
> return rhs == KNOWN_VAL ? 0 : -1;
> }
> else if (rhs == KNOWN_VAL)
> {
> return 1;
> }
> return string.Compare(lhs, rhs);
> }
> int IComparer.Compare(object lhs, object rhs)
> {
> return Compare(lhs as string, rhs as string);
> }
> }
> static class Program
> {
> static void Main() {
> string[] vals = { "AA", "XXX", "Z" };
> Array.Sort<string>(vals, XxxComparer.Default);
> foreach (string val in vals)
> {
> Console.WriteLine(val);
> }
> }
> }
|
| |
|
| |
 |
Ignacio

|
Posted: Wed Mar 26 10:10:56 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
On Mar 26, 8:21=A0am, "Jeta" <EMail@HideDomain.com> wrote:
> Hello All,
>
> I stumped and I need some help. I have an unsorted string array that looks=
> something like:
> AA
> XXX
> Z
>
> and I would like to sort it like:
> Z
> AA
> XXX
>
> or like:
> XXX
> AA
> Z
>
> My research has lead me to using the IComparer interface. What I am having=
> difficulties with is developing a class that will take an unsorted string
> array (as noted above) and return a sorted string array (as noted above)
> using the IComparer interface.
>
> Thanks in Advance!
Hi,
Yes, you need to create a class that implements the IComparer.
There are other ways though, depending of what kind of collection you
have and what version of the framework you are using
If you are using 2.0+ and a generic collectin you can do something
like:
myList.Sort(delegate(string T1, string T2) {
return T1.CompareTo(T2);
});
|
| |
|
| |
 |
Marc

|
Posted: Wed Mar 26 10:18:12 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
Re the XXX - I was (and still am) unclear about what the sort order
should be - is this "by length"? because otherwise as far as I am
concerned, AA, XXX, Z is already sorted. The IComparer approach should
work in 1.1, but I don't have any 1.1 tools available to verify; but
the following *might* compile in 1.1 ;-p
using System;
using System.Collections;
public class XxxComparer : IComparer
{
public static readonly IComparer Default = new XxxComparer();
const string KNOWN_VAL = "XXX";
public int Compare(string lhs, string rhs)
{
if (lhs != null && rhs != null)
{
int result = lhs.Length.CompareTo(rhs.Length);
if (result != 0) return result;
}
return lhs.CompareTo(rhs);
}
int IComparer.Compare(object lhs, object rhs)
{
return Compare(lhs as string, rhs as string);
}
}
static class Program
{
static void Main() {
string[] vals = { "AA", "XXX", "Z" };
Array.Sort(vals, XxxComparer.Default);
foreach (string val in vals)
{
Console.WriteLine(val);
}
}
}
|
| |
|
| |
 |
Jeta

|
Posted: Wed Mar 26 11:06:16 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
>>...as far as I am concerned, AA, XXX, Z is already sorted.
If the sort is occurring on the first character, you are 100% correct. Using
the AA, XXX, Z example, I see XXX being greater than Z.
FYI, the letters that I am describing are actually revision levels coming
from a CAD drawing. What I am trying to do is get the last revision level
from an array - in this case the last revision level would be XXX
Thanks
"Marc Gravell" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Re the XXX - I was (and still am) unclear about what the sort order
> should be - is this "by length"? because otherwise as far as I am
> concerned, AA, XXX, Z is already sorted. The IComparer approach should
> work in 1.1, but I don't have any 1.1 tools available to verify; but
> the following *might* compile in 1.1 ;-p
>
> using System;
> using System.Collections;
>
> public class XxxComparer : IComparer
> {
> public static readonly IComparer Default = new XxxComparer();
> const string KNOWN_VAL = "XXX";
> public int Compare(string lhs, string rhs)
> {
> if (lhs != null && rhs != null)
> {
> int result = lhs.Length.CompareTo(rhs.Length);
> if (result != 0) return result;
> }
> return lhs.CompareTo(rhs);
> }
> int IComparer.Compare(object lhs, object rhs)
> {
> return Compare(lhs as string, rhs as string);
> }
> }
> static class Program
> {
> static void Main() {
> string[] vals = { "AA", "XXX", "Z" };
> Array.Sort(vals, XxxComparer.Default);
> foreach (string val in vals)
> {
> Console.WriteLine(val);
> }
> }
> }
|
| |
|
| |
 |
Marc

|
Posted: Wed Mar 26 15:10:43 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
> If the sort is occurring on the first character, you are 100% correct. Using
> the AA, XXX, Z example, I see XXX being greater than Z.
Maybe I'm being really slow today - but would you care to explain
those rules? Why would the last revision be XXX? Is the problem is
that you want 123 to follow 29? In which case, the code I posted last
time might do the job... it compares by length first, and (for equal
length) compares as normal...
Marc
|
| |
|
| |
 |
Jeta

|
Posted: Thu Mar 27 10:21:20 CDT 2008 |
Top |
Visual C#.Net >> Using IComparer to Sort a String Array
Hi Marc,
>> Maybe I'm being really slow today
No! I was probably not explaining myself clear enough.
>> but would you care to explain those rules?
XXX was just an example. Actually, the highest revision level is ZZZ for
mechanical engineering CAD drawings and 999 for architectural engineering
CAD drawings. Now you may ask :-) why would the last revision level be ZZZ
or 999? My response is it's a company standard.
Our CAD drawings have a placeholder for a maximum of three revision levels.
When a new mechanical engineering CAD drawing is created it's revision level
is "A". When a change is made, to this type of CAD drawing, the revision
level is incremented to the next letter. This process is repeated for each
engineering change.
Since I stated there's a placeholder for a maximum of three revision levels,
revision "D" would replace the revision "A", revision "E" would replace
revision "B" and revision "F" would replace revision "C", etc., etc., etc.
When the last revision is "Z", the next revision would be "AA" followed by
"AB", "AC", "AD", ...,"AZ", "BA", "BB", ...,"BZ", ...,"ZA", ..., "ZZ",
"AAA", ...,"AAZ", etc., etc., etc. So, theoretically a mechanical
engineering CAD drawing could have 17,576 revisions. Will there ever be that
many revision levels? NO WAY!
I hope the above wasn't to much babble!
>> Is the problem is that you want 123 to follow 29?
Yes, Yes, Yes :-) I haven't tested your code with numbers, but I have tested
it with letters. Here's an example. Your code will sort the following string
array:
Z
AA
AB
Like this:
AA
AB
Z
I needed it to be sorted like:
Z
AA
AB
After studying your code and other responses, here's what I came up with:
public class sortRevision : IComparer
{
int IComparer.Compare(Object x, Object y)
{
int val = ((new CaseInsensitiveComparer()).Compare(x, y));
string localx = (string)x;
string localy = (string)y;
if (val < 0)
{
if (localx.Length > localy.Length)
val = 1;
}
if (val > 0)
{
if (localx.Length < localy.Length)
val = -1;
}
return val;
}
}
I am calling the above as follows:
Array.Sort(allRevLevels, (IComparer)new sortRevision());
Any suggestions are welcome and greatly appreciated!
Thanks!
"Marc Gravell" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>> If the sort is occurring on the first character, you are 100% correct.
>> Using
>> the AA, XXX, Z example, I see XXX being greater than Z.
>
> Maybe I'm being really slow today - but would you care to explain
> those rules? Why would the last revision be XXX? Is the problem is
> that you want 123 to follow 29? In which case, the code I posted last
> time might do the job... it compares by length first, and (for equal
> length) compares as normal...
>
> Marc
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- Net Framework >> ASP.NET lock upHi. I'm experiening random lockups of my ASP.NET application. I see lots of
these error messages from .NET runtime in the event log:
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: .NET
Runtime version 1.1.4322.2032- Setup Error: Failed to load resources from
resource file
Please check your Setup.
What does this mean and could it be related to the problem?
Casper
- 2
- Visual C#.Net >> User Control Events - HELPHi everyone,
I hope you can help me. I have a User Control, which has a Label that covers
the entire control. I want to assign a MouseClick event to the User Control,
however, the event does not fire because the click fires the MouseClick
event on the Label rather than the User Control.
Is there a way to have this work by firing the MouseClick event on the User
Control?
Thanks in advance,
Timothy.
- 3
- Net Framework >> TCPClient - Detectiing loss of remote host connectionBefore I go and make massive changes to a TCP/IP library I made, I was
wondering if the detection of connection loss is possible through the
TCPClient class.
The problem I have is that I make a connection to another application using
a TCPClient in one app and a Listener with Client in the other app. I close
the app with the listener. I then try to send data to the listener app.
TCPClient.Connected returns true after the remote connection is forcefully
closed. I understand that the value of TCPClient.Connect is based on the
success of the previous send/recieve action. When I perform a send operation,
there is no exception thrown. Trying to perform a send operation a second
time throws a socket exception stating the connection was closed at the
remote end.
I was hoping that the exception would be thrown on the first send operation
after the connection was closed. Any way around this or will I have to send
test bytes at the start of each send operation in order to test the integrity
of the TCP connection? Any help would be great thanks :o)
- 4
- Dotnet >> Legal or Scam??Lately I've been getting lots of spam, selling cheap software. The website was oemsoftwarehouse.com. They supposedly were selling oem software of Borland's Delphi and Microsoft's Visual Studio. They said it was only $60 for Delphi 7 Enterprise, but Borland sells it for over $2,500 USD! I don't know the cost of Visual Studo, but the website was offering it for $130 USD. Generally, if it sounds too good to be true, it isn't. Is there such a thing as an OEM version of Visual studio? If I order this, will I be buying pirated software? Will I be breaking any laws using this software?
Thanks!
Debbie
- 5
- Visual C#.Net >> PocketIE, Javascript, and C# ActiveX alternative?I posted this in PocketPC newsgroup with no response yet, hopefully
somebody here has an answer.
I have an application that runs locally on PocketPC. The user
interface for this application is HTML with Javascript. The Javascript
on the page instantiates an ActiveX control written in C++ ATL. The
ActiveX does not have a visual interface and its basic functionality is
to access the serial port and do some calculations and return the
result.
I am in process of re-writing the application and was thinking to
create a C# alternative to the C++ ATL ActiveX and maybe even simplify
the installation process by eliminating the need to register the
control.
Is it possible to create a C# control to be instantiated by Javascript
and run by PocketIE locally in a PocketPC? I appreciate it if you can
point me to some articles or sample codes doing this.
- 6
- Dotnet >> Activation context generation failedHello
When i add new resource files to my usercontrol project and i compile the
project a i get a error message in the event log
Activation context generation failed for
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\AL.exe". Dependent Assembly
Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.20129.4864"
could not be found. Please use sxstrace.exe for detailed diagnosis.
i am running Windows Vista en VS2500 + SP1+Vista SP 1 update
is this a know problem ?
kind regards
Dieter
- 7
- Visual C#.Net >> Excel WorkBook.OpenText returns VOID!!!Hi all,
As you may have guess, I'm working with the Excel object in C#. I am
trying to open a comma-delimited (.csv) file in Excel so I can easily
transfer the data to another Excel WorkBook.
I have read many examples online which all reference the
WorkBook.OpenText method -- for example:
myWorkBook = myApplication.WorkBooks.OpenText(blah, blah, ...);
Here is the problem, When I try to implement that code the OpenText
method returns void - thus rendering a compiler error.
COM Library
-----------
Microsoft Excel 11.0 Object Library
Code
----
rdWorkBook = rdApp.Workbooks.OpenText(
rawDataFile,
Type.Missing,
1,
Excel.XlTextParsingType.xlDelimited,
Excel.XlTextQualifier.xlTextQualifierDoubleQuote,
Type.Missing,
Type.Missing,
Type.Missing,
true,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing);
---------------------
So, in order to work past this issue I used the WorkBook.Open method.
I can open the .csv file ok, however it is not recognizing the comma
delimited notation - so it essentially opens the file as a text file
rather than an Excel file (if you know what I mean).
Here is my code:
myWorkBook = myApp.Workbooks.Open(
rawDataFile,
0,
true,
5,
"",
"",
true,
Excel.XlPlatform.xlWindows,
",",
false,
false,
0,
true,
false,
false);
---------------------
Anyhow, does anyone know what's up? Is there a better way?
Thanks in advance!
Jes
- 8
- ADO >> Simple Multiple Row Insert QuestionHi everyone,
I have a pretty simple situation and I'm hoping that someone could give
me some advice on the best way to handle it.
I need to insert a whole load of rows into SQL Server 2005 using ado.net.
I use custom business objects to represent the rows. So for example, in
this specific case, I have a big collection of "Booking" objects.
I also have a stored procedure called CreateBooking.
My question is - assuming that I need to import say, 7000 rows in one
go, is simply looping through the Bookings collection and calling the
Stored Procedure for each booking the best way to do things?
Is there some other way to get that much data into the database without
constantly calling the stored procedure 7000 times.
I use the same connection each time, but still, it seems a bit clumsy.
I was wondering if there is a better way.
Many thanks to anyone who can advise...
Simon
PS: I really need to use ADO.net to do this - importing by some other
mechanism isn't going to be possible in this instance
- 9
- Dotnet >> Windows desktop search API in ASP.NETCan anyone know how to use WDS API in ASP.NET?
I copied the Win App sample to ASP.NET, but recevied the following
error:
Exception Details: System.InvalidCastException: QueryInterface for
interface Microsoft.Windows.DesktopSearch.Query.ISearchDesktop failed.
- 10
- Microsoft Project >> merge keysI am curios if there is any way to have multiple merge
keys for MS project. I am working in 2000 and haven't
found a way, but I was wondering if the newer versions had
this feature.
Thanks,
- 11
- Visual C#.Net >> Very odd Sort problem when modifying DGV bound data(I posted this in a databinding NG, but it's a VERY low traffic NG so I
thought I would post here as well. I hope no one minds too much, if you do
I'm sorry)
I have a DGV that is bound to a DataTable that is loaded during application
startup. I can sort with all the columns and everything works fine. I have
a method that can be invoked from a context menu that will loop through the
rows of the bound table and modify a specific cell in each row. After
modifying the rows sorting doesn't work for that column anymore.
To give a more familiar example:
Load the Products table from the Northwind DB
Bind to a DGV via a BindingSource object
Test teh sorting by clicking on the DGV columns
add a button and in the click handler, loop through the DataRow collection
and set the ProductID column to the value using an int that increments in
the loop.
Try and sort the ProductID column.
You will get incorrect results, it will sort 20 or so rows, then jump to
another number, then jump again.. it's broken.
I've tried everything I can think of:
calling EndEdit on each row
reseting bindings
etc
Nothing seems to solve it. I'm not one to cry "bug" but this sure seems
like one to me.
Anyone ever experience this? Anyone happen to have a demo application setup
with Northwind they could quickly check this? I've spent over a week now
trying to find the problem and I can't. :(
Any help or input greatly appreciated!
Thanks for reading,
Steve
- 12
- Winforms >> Trying to learn more regarding interface based developmentHey guys,
I am looking to learn more about interfaced-based design / component-based
programming. I want to be able to write better code, with easier
maintainability and better code reuse since implementation is separated from
the interface.
Any suggestions on reading material?
Thanks.
- 13
- Visual C#.Net >> Accessing Resources from an MSG fileWe are attempting to replace one of our legacy services (developed in C++)
with one that is developed as a C# service. The problem that I am
encountering is dealing with the resources that are generated from the MSG
file. These resources are used both by the existing service code (to format
strings for internal use) and by the Event Viewer when entries are written
to the Event Log to be associated with this source.
1. Can I access an existing resource file inside an existing EXE (built from
a VC++ 6 source) from a C# service? I have tried the
CreateFileBasedResoruceManager() call, but either I have the parameters
wrong or this is not possible. The method call actually works, but when I
attempt to retrieve a string, I get an MissingManifestResourceException
error.
2. If I create the resources in a satellite assembly, will the Event Viewer
still be able to use the contents?
-Ken
- 14
- Visual C#.Net >> WinForms And XMLI saw the following requirement somewhere:
"....using WinForms and the screens should be described in XML. The XML is
to prescribe both the layout as well as the connectivity to the underlying
model"
Can someone tell me how a Windows Form can be described in XML?
- 15
- Net Framework >> Can't enable tracing via app.configI've used tracing before, but today I've tried everything and can't get
a simple sample working.
This is my app config (I've also tried specifying a fully qualified type
name for the type attribute of the add element):
<configuration>
<system.diagnostics>
<trace autoflush="false">
<listeners>
<add name="bob"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="E:\log.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
I've added the #define DEBUG directive to the only code file in my
project. When I run the app and examine the Listeners collection, there
is only the one DefaultTraceListener, no TextWriterTraceListener.
I can't figure out why...
|
|
|