|
chenli0513 wrote: i want get the regular of the website
then i can download it by the regular!
thanks you help!
chenli0513@yahoo.com.cn lee!
Sorry, your question doesn't make any sense.
What do you mean by "the regular" of the website?
Try carefully rewriting your question so we can understand you.
Simon
|
|
|
|
|
Change the subject line, I might add
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
http://www.albahari.com/nutshell/predicatebuilder.html[^]
I found a link about expressions. Can someone explain that how can I use? Is it helpfully?
or are there any idea for my problem with LINQ and expressions? (please don't say REGEX)
I have a class like this:
public class SearchWord
{
...
public string Search_key { get; set; }
public string And_key { get; set; }
public string Not_key { get; set; }
...
...
}
SearchWord sw1 = {Search_key = "test", And_key = "", Not_key = ""};
SearchWord sw2 = {Search_key = "test", And_key = "email", Not_key = ""};
SearchWord sw3 = {Search_key = "test", And_key = "email", Not_key = "engin"};
I have a big text:
string forSearch = "test hkkdkh yrfjkdh ggshdj bla bla bla email bla bla sdkj engin";
there are 4 case for my situation:
test = returns bool
test and email = returns bool
test and engin = returns bool
test and email and engin = returns bool
Now, I want to compare this 4 result and return SearchWord(if result = true)
Please help me...
|
|
|
|
|
enginço wrote: please don't say REGEX
Uhmmmmmmm...Regex ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yeahhh, finally I solved my problem with expressions and linq.
There is no REGEX
thanx o'relly books
|
|
|
|
|
How can i get the button click event of a button placed within a datagridview
|
|
|
|
|
|
Hi All,
I want to get the record count for a SQL Query other than count(*), because dont want to manipulate the query. I want to get the record count for any given query. Is there any method available in .net?
Or is there any method available in SQLBulkCopy Class as I'm using it?
For example given query is "Select x,y from z where x=l", I need to get the record count for that.
Any ideas?
Thanks in Advance
Shah_tech
|
|
|
|
|
execute the query and look at how many rows are returned?
|
|
|
|
|
Try this:
Select count(*) from z where x=l;
Would return the number of rows which meets the where clause.
|
|
|
|
|
But, I dont want to even modify the given query. And I dont want to execute the query and get the count using loops because my query will return arount 1crore records. I just want to get the record count directly without modifying the existing query.
any more ideas?
Thanks in advance
Shah_tech
|
|
|
|
|
Hi,
Without any more info about the problem (what database, connection type etc.), it's hard to give any exact answer, but some ideas might be useful:
1. If you execute a select statement using SQLCommand (or corresponding class) and then get the row count from returned SQLDataReader class using property ReccordsAffected. You get the actual count of returned rows without any loop.
2. If you don't want to manipulate the original query, you can still construct a nested query. For example:
string originalQuery = "SELECT x,y FROM z WHERE x=l";
string countQuery = "SELECT COUNT(*) FROM (" + originalQuery ")";
SQLCommand countCommand = new SQLCommand;
countCommand.CommandText = countQuery;
...
This would result in a query which executes the original query, creates a result set which is then counted. So this means it returns only one row and one column, the record count.
This solution varies between different databases, because all databases cannot handle nested result sets.
3. Create a stored procedure into the database which actually executes the statement and returns the row count. Something like this semi-code
PROCEDURE RowCount(IN statement, OUT rows)
BEGIN
EXECUTE statement;
rows = SQL%ROWCOUNT;
END;
4. If possible, ask the datatabase optimizer how many rows it thinks may be returned (using procedure). This implementation is fully database-dependent.
Hope this helps,
Mika
|
|
|
|
|
I am making an application in which I need to generate dyamic code. I will try to explain with this example:
say user selected "Label" from a combobox. So I need to create an object of Label class. I tried Convert.ChangeType , tried using DynamicMethod class but could not succeed.
|
|
|
|
|
Got it!! (I think )
I used System.CodeDom.CodeVariableDeclarationStatement class. Still havent got the intended result but atleast moved ahead(or somewhere else).
|
|
|
|
|
|
Hi, I am new to .Net.
My question is "How can I disable the screen saver of current session, when I logged in with normal user?"
|
|
|
|
|
2 ways:
1) Registry. Check and modify the key at HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveActive
2) Call the SystemParametersInfo[^] API method and pass SPI_SETSCREENSAVEACTIVE[^] which has a value of 17.
Don't know about being admin user or not. As the reg key is in the current user hive, I would assume you can write to it as a non admin user, but I haven't tried it.
Simon
|
|
|
|
|
Integrate in your program a method that moves the mouse just enough to offset the screen saver timer. I would not suggest it though as it is not really use friendly.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
hi,
can any body tell me that Unified communication client api works with any server other than office communication server. Basically, i am working on an IM application using uccapi.
I have heard that uccapi only work with Microsoft and with nothing else. I have tried to find out regarding this issue on the internet but so far no success.
any help is highly appreciated.
thnx.
|
|
|
|
|
like in the Unified Communication client api sdk it is written that:
"Before you start, ensure the following requirements are met:
Microsoft Office Communications Server 2007 is installed on the server side of all Unified Communications Client API clients."
Means If I do not have or I dont want to have Microsoft Office Communication Server 2007, than i can not use Unified Communication client api.
thnx
|
|
|
|
|
ObjectQuery query = new ObjectQuery("Select * from Win32_NTLogEvent Where LogFile='Application'");
it gives, Timewritten= 20080715091712.000000+330
Now how can i convert it to DateTime, as it is giving errors when i converting it to DateTime.
|
|
|
|
|
Mogaambo wrote: Now how can i convert it to DateTime, as it is giving errors when i converting it to DateTime.
Parse it yourself. string.Substring()...
|
|
|
|
|
how to use IsNumeric Function in c#
it is working fine in vb.net. i think some namespace should be included.
please help me.
thanks
|
|
|
|
|
There is no such function in c# but u can create one
try
{
int num=Integer.parse("10");
return num;
}
catch(Exception ex)
{
return "Invalid number";
}
|
|
|
|
|
add a reference : "Microsoft.VisualBasic"
then use:
Microsoft.VisualBasic.Information.IsNumeric(...);
|
|
|
|