Click here to Skip to main content
15,908,175 members
Home / Discussions / C#
   

C#

 
QuestionGraphics in C# Pin
Jeea20068-Mar-06 3:42
Jeea20068-Mar-06 3:42 
AnswerRe: Graphics in C# Pin
Judah Gabriel Himango8-Mar-06 3:55
sponsorJudah Gabriel Himango8-Mar-06 3:55 
GeneralRe: Graphics in C# Pin
Jeea200618-Mar-06 22:49
Jeea200618-Mar-06 22:49 
AnswerRe: Graphics in C# Pin
_awatts8-Mar-06 9:05
_awatts8-Mar-06 9:05 
GeneralRe: Graphics in C# Pin
Jeea200618-Mar-06 23:01
Jeea200618-Mar-06 23:01 
AnswerRe: Graphics in C# Pin
_awatts20-Mar-06 9:53
_awatts20-Mar-06 9:53 
QuestionAlternatives to DataTable Searches? Pin
Paul Gates8-Mar-06 2:30
Paul Gates8-Mar-06 2:30 
AnswerRe: Alternatives to DataTable Searches? Pin
Wjousts8-Mar-06 3:30
Wjousts8-Mar-06 3:30 
I encounted a similar problem. It's quite frustrating that searching in a datatable isn't more flexible. I found a partial solution by parsing the search string to replace wildcards in the middle of the search string like this:
private string ParseWildCards(string strWild)
{
	// Look for wildcards that DO NOT occur at the start or end of the string
	Regex reg = new Regex(@"(?<=.)\*(?=.)");
	if (reg.IsMatch(strWild))
	{
		// We have a wildcard in the middle of the expression - check this is actually a LIKE - else it won't work
		int i = strWild.IndexOf("LIKE");
		if (i > 0)		
		{
			string col = strWild.Substring(0,i).Trim();	// get the column name
			string strReplace = "*' AND " + col + " LIKE '*";
			return reg.Replace(strWild,strReplace);
		}
	}
	return strWild;
}


This will replace a string like "col like 'aaa*bbb'" with "col like 'aaa*' and col like *bbb' which kind of works except that there is no way to stop it matching a string like '...bbbaaa...' because you can't specify that it should match the 'aaa*' part before the '*bbb' part.

If anybody has a better solution I would love to hear about it.
GeneralRe: Alternatives to DataTable Searches? Pin
Paul Gates8-Mar-06 5:07
Paul Gates8-Mar-06 5:07 
QuestionAbout mainFrame communicate with thread Pin
breakhearts8-Mar-06 2:18
breakhearts8-Mar-06 2:18 
AnswerRe: About mainFrame communicate with thread Pin
mav.northwind8-Mar-06 2:54
mav.northwind8-Mar-06 2:54 
QuestionDeclaring a arrays of objects dynamically Pin
winpoorni8-Mar-06 1:12
winpoorni8-Mar-06 1:12 
AnswerRe: Declaring a arrays of objects dynamically Pin
Stefan Troschuetz8-Mar-06 1:32
Stefan Troschuetz8-Mar-06 1:32 
AnswerRe: Declaring a arrays of objects dynamically Pin
Divyang Mithaiwala8-Mar-06 1:51
Divyang Mithaiwala8-Mar-06 1:51 
QuestionRe: Declaring a arrays of objects dynamically Pin
winpoorni8-Mar-06 17:32
winpoorni8-Mar-06 17:32 
AnswerRe: Declaring a arrays of objects dynamically Pin
Divyang Mithaiwala8-Mar-06 17:42
Divyang Mithaiwala8-Mar-06 17:42 
JokeDeclaring a arrays of objects dynamically Pin
winpoorni8-Mar-06 18:25
winpoorni8-Mar-06 18:25 
AnswerRe: Declaring a arrays of objects dynamically Pin
Wjousts8-Mar-06 3:33
Wjousts8-Mar-06 3:33 
AnswerRe: Declaring a arrays of objects dynamically Pin
Judah Gabriel Himango8-Mar-06 4:01
sponsorJudah Gabriel Himango8-Mar-06 4:01 
JokeThanks Pin
winpoorni8-Mar-06 17:41
winpoorni8-Mar-06 17:41 
Questionmanually running class library in cmd Pin
sasire188-Mar-06 0:27
sasire188-Mar-06 0:27 
AnswerRe: manually running class library in cmd Pin
Steve Hansen8-Mar-06 0:52
Steve Hansen8-Mar-06 0:52 
QuestionConvert struct to byte[] Pin
Divyang Mithaiwala8-Mar-06 0:26
Divyang Mithaiwala8-Mar-06 0:26 
AnswerRe: Convert struct to byte[] Pin
Le centriste8-Mar-06 1:06
Le centriste8-Mar-06 1:06 
GeneralRe: Convert struct to byte[] Pin
Divyang Mithaiwala8-Mar-06 1:35
Divyang Mithaiwala8-Mar-06 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.