|
You're welcome
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi all,
i have two different sources.. a Dataset and a String with XML data
I was thinking of converting the Dataset into an XML document, and the string to an XML document and then comparing the two. First of all, is this a viable solution?
Secondly, I know that the data in both XML documents will not be the same (i.e. the actual attributes are not the same) but there are some overlapping attributes like for example NAME, SIZE, EXISTS etc...
How can I compare the two without using a simple shortcut like xml diff
|
|
|
|
|
Could you tell me how to use Application.ApplicationExit event? and I want my program to do somehing before my computer closes. Would you mind teeling me how I can do?
Thanks in advance.
|
|
|
|
|
|
hi evryone
is it posible to open 2 database together in win CE ?
i working in Sql CE
if (answer == 'yes')
MessageBox (the answer)......
than'k alot for any help
|
|
|
|
|
Have you tried? I would imagine using two SqlServerCeConnection objects would do the trick. It is a rather simple test.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
i'll try, and it not work
if it was work....i never ask......
|
|
|
|
|
My requirement is : I will be having billions of data records coming in per day.From those I have to filter some 1000-2000 records based on record names which are stored in a filter. Reading from that filter should continue while we should be able to update the filter for new records .
My doubt is what is the suiatble data structure to be used and can multithreading be used ??
|
|
|
|
|
|
can you please help me....
i have the following code firstly i want to know if logic is correct then secondly i want to know how do i exist the second for loop to get back into the first for loop. the reason for this is once the values in one of the columns of the two tables is different it should write to a temp table in the database and then it should go out of that row and test the next row in the datarow.
code is below
OpenDb();
SqlQuery = "select * from " + Table1 + " where " + txt_comkey_tbl1.Text + " in (select " + txt_comkey_tbl2.Text + " from " + Table2 + ")";
sqlquery = "select * from " + Table2 + " where " + txt_comkey_tbl2.Text + " in (select " + txt_comkey_tbl1.Text + " from " + Table1 + ")";
DataSet ds = new DataSet();
OleDbDataAdapter oda = new OleDbDataAdapter(SqlQuery,dbConn);
oda.Fill(ds, Table1);
int intSkip2 = 0, w = 0;
int intSkip3 = 0, k = 0;
DataSet dp = new DataSet();
OleDbDataAdapter oda1 = new OleDbDataAdapter(sqlquery,dbConn);
oda1.Fill(dp, Table2);
//check what the dataset contains
foreach (DataRow dr in ds.Tables[Table1].Rows)
{
foreach (DataRow drp in dp.Tables[Table2].Rows)
{
for (int i = 0; i < ds.Tables[Table1].Rows.Count; i++)
{
for (int p = 0; p < ds.Tables[Table1].Columns.Count; p++)
{
if (dr[p].ToString() == drp[p].ToString())
{
string tableresults3 = dr.ItemArray[p].ToString();
string tableresults4 = drp.ItemArray[p].ToString();
}
else
{
string tableresults5 = dr.ItemArray[p].ToString();
string tableresults6 = drp.ItemArray[p].ToString();
insertquery = "select * into mytable from " + Table1 + " where " + ds.Tables[Table1].Columns[i].ToString() + " = " + dr.ItemArray[i].ToString();
insertquery2 = "select * into mytable2 from " + Table2 + " where " + dp.Tables[Table2].Columns[i].ToString() + " = " + drp.ItemArray[i].ToString();
OpenDb();
dbCmd = new OleDbCommand();
dbCmd.Connection = dbConn;
dbCmd.CommandText = insertquery;
dbCmd.CommandType = CommandType.Text;
dbCmd.ExecuteNonQuery();
OpenDb();
dbCmd = new OleDbCommand();
dbCmd.Connection = dbConn;
dbCmd.CommandText = insertquery2;
dbCmd.CommandType = CommandType.Text;
dbCmd.ExecuteNonQuery();
}
}
}
}
}
|
|
|
|
|
No, it's definitely not correct.
Some major issues:
:: You are comparing every row in Table1 with every row in Table2, and you are comparing every combination of rows the number of times that there are rows in Table1. So, if you have 100 rows in Table1 and 100 rows in Table2, you are making 10000 combinations, and you compare each combination 100 times making a total of 1000000 comparisons.
:: The variable i is an index of the rows in Table1, but you are using it as an index for the columns in Table1 and Table2.
:: You are getting the values from the fields and using as field names in the insert queries.
:: You are opening a new database connection for every database query, but you are never closing any connections.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: a total of 1000000 comparisons
use of a thousands separator, or scientific notation, would improve readability...
|
|
|
|
|
Plus, you've got serious issues with SQL injection as well.
Take a search in CodeProject about finding ways to resolve them.
|
|
|
|
|
I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so.
so i have 2 methods
1) returns a json result . In that json result there is a property called data. that property is of type object but internally it's a list of anonymous variables
2) the method calls method 1 and checks if the returned jsonresult is ok.
if i run the test and i break the debugger i can hover over the result and see the items in it. i just don't find a way to do so in code.(just using a foreach isn't possible because at the point i need it i'm not in the method that created the anonymous method)
|
|
|
|
|
Hello all! I've got an application that is setting on a server that is run my multiple users. The user's shortcuts are pointed to the .exe on the server, which can in some cases be located in a different office miles away. I have read the article dll search order article on msdn
http://msdn.microsoft.com/en-us/library/ms682586(VS.85).aspx[^]
It states that the initial search for the dll's will be done in the directory where the app was launched from. It's going to find them in this case which I would assume could be bad considering they are on a remote server(for performance reasons). If I use the SetDllDirectory() function and make sure that each user has the dlls locally, am i only changing the searh order for my specific application?
Any other info would be greatly appreciated. Thanks
|
|
|
|
|
A quick read of the documention on SetDllDirectory[^] says it's only for the application.
|
|
|
|
|
I want to do mouse gesture for draw line on desktop. Which draw without window.
Who can do it or have some advices. Please contact to me or post source code about its.
Thank You so much.
|
|
|
|
|
|
I think he's actually wanting to draw straight to the desktop without having an application window open. I think that's going to get a bit advanced.
|
|
|
|
|
The article I pointed should help him as it shows how to obtain Graphics instance associated with desktop. Next step is intercepting mouse movement.
|
|
|
|
|
I see! I didn't take very close look at the article before posting that. Hopefully he does!
|
|
|
|
|
You guys are awesome - this helped me out perfectly. Thanks for taking the time to post.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Yes, I need draw with Mouse but without window form
I need recognition with mouse same in PDA phone.
Please help me...
|
|
|
|
|
|
I don't understand. I'm beginner.
please give more tip to me, thank so much.
|
|
|
|