|
Don't forget, you fail.
Next time you want work done for free, go to class or better yet, support real programmers and go to this site[^] so at least the people who contracted to you get something for their money, jerkoff.
|
|
|
|
|
Member 3916856 wrote: PDA is a Personal Digital Assistant that a person can use as a portable computer.
My god, If only I had known that earlier. That makes everything clear. A portable computer, YES! Like... like a Nintendo gameboy?
|
|
|
|
|
Ja its more like that, I haven't started my code. I was wondering if is there any material that u guys can provide. Or where i can get hepl from. Thnx
|
|
|
|
|
*sigh* I'll probably get downvoted for this, but here you go.
The only way I know how to do this is with Visual Studio and using C# because I presume you knew that this is a C# forum, right? Don't ask me how to use this with Embedded Visual C.
1) Use Visual Studio to set up a smart device project
2) Connect PDA with tether - you may need to use ActiveSync
3) Build/Test using the emulator
4) Deploy with VS to device when you're satisfied with results
Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|
No downvote here. This is a perfect breakdown of the process and covered with remarkable patience.
|
|
|
|
|
Thanx, if u know what material I can use for this plz send it to me as a URL or site-address
|
|
|
|
|
Me neither. Did you mean to ask how to upload a program to a PDA?
|
|
|
|
|
that as will, I haven't start-up with my code thou
|
|
|
|
|
The project I am currently working on retrieves a tree structure from the DB, keeping it in a data set. I am trying to find a faster way of getting rows back, as if the tree has 100k relationships, this takes some time (around the 4min mark).
I currently use dataSet.Tables[0].Select("[Parent] = " + parent); . I read on the web that Rows.Find(key); is faster, however, since I am building a tree, I need to retrieve the parents, which isn't a key.
So the question is, does anyone know of a better method to retrieve data from a data table?, or any other suggestions, I could look into not using a data table.
Cheers.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
why dont you go throught the table sequencially and put the value where you need it in the tree?
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
Do you already use recursion. You would start with rows having parent equal to null and then search the data recursively (while building the tree).
Perhaps if you could explain a bit more about the problem it would be easier to make suggestions.
|
|
|
|
|
Yes I do use recursion. I'll try to explain it more in depth. I am building a graph using a 3rd party DLL (see: yWorks.com). The model builds around 4k relationships every 10 seconds when viewing a large amount of data (95k relationships). The model is built on levels, e.g: when the user first opens the program, it retrieves all the data for the whole model, and builds 2 levels. The user can then expand to as many levels as they like.
Below is a quick sample of the code I use to build the model.
private void BuildModel(Node node, int currentLevel)
{
if ((currentLevel + 1) > _modelLevel)
return;
currentLevel++;
DataRow[] matchingRows = _relationshipDataSet.Tables[0].Select("[" + PARENT + "] = '" + node.Name + "'");
if (matchingRows == null || matchingRows.Length == 0)
return;
foreach (DataRow row in matchingRows)
{
string childName = row[CHILD].ToString();
string nodeHashCode = childName + node.Name + node.GetHashCode().ToString();
if (!_graphNodeHashSet.Contains(nodeHashCode))
{
_graphNodeHashSet.Add(nodeHashCode);
BuildModel(childNode, currentLevel);
}
else
{
List<node> nodeList = new List<node>();
bool isValid = _nodeDictionary.TryGetValue(childName, out nodeList);
if (isValid)
{
foreach (Node childNode in nodeList)
{
BuildModel(childNode, currentLevel);
}
}
}
}
}</node></node>
Hope this helps some more. I am also using .NET 2.
Regards,
Gareth.
(FKA gareth111)
modified on Friday, February 6, 2009 4:48 AM
|
|
|
|
|
Gareth H wrote: retrieves a tree structure
Are you building a TreeView?
If so, I would likely do it as:
0) Query the root-level data (parents)
1) Iterate those values
1.0) Insert the value to the TreeView
1.1) Query for the children of that value
1.2) Iterate the children
1.2.0) Add the child to the parent's node
... and so on
(You do have an index for the parents, yes?)
Or, perhaps, this way (which uses more resources):
0) Query all the data, as you do now
1) Iterate the parents
1.0) Insert the value to the TreeView
1.1) Also add the parent's ID and node to a Dictionary<id,node>
2) Iterate the children
2.0) Get the Parent's node from the Dictionary
2.1) Add the child to the parent's node
2.2) If the children have children, add the node to a Dictionary (the same one or another, depending on your schema)
... and so on
|
|
|
|
|
Why are you storing this data in a DataSet? The overhead in maintaining this is very heavy, and won't help your situation. If you are using Sql Server 2005/2008, you could always use Common Table Expressions to get the hierarchical data out of the database in a hierarchical fashion far faster than you could using the dataset.
|
|
|
|
|
The project is database in-dependent, ie: we support SQL Server 2005/2008, Oracle, Access, etc so using something that would work on SQL Server but not Oracle wouldn't really suit my situation.
The data is currently retrieved from the DB in chunks (around 5k rows), stored in a data set. The reason I am storing in a data set is because that is the format which it is given to me in (my code does not handle data retrieval). However, if you know of a better way that isn't database specific, I could look into this/talk to my supervisor.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
For really fast tree retrieval use a trigger that uses CTEs to keep a text lineage column update, so you have a list of parents: /1/2/3/4/.
This makes selection quite fast, for example to grab an entire subtree you can just do a where lineage like %/num/%, etc.
|
|
|
|
|
Hello.hi have a problem whit a programe where i whant to send data from textbox to datagridview in a diferent form.
|
|
|
|
|
create a public method in the form with the datagrid that takes a string paramter.
then from the textbox form call the method and pass the textbox.Text value
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
And now the difficult part, pseudo code to C#...
|
|
|
|
|
its prob not what he is trying to ask anyway
OP, give use some more info
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
can somebody help me how to connect a database server located in unix box..
i want connection string..
Thank in advance
vikas da
|
|
|
|
|
I know nothing about connection strings (I'm not from Barcelona though), but these people do[^].
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:32 AM
|
|
|
|
|
Doesn't depend on the os, it depends on the database. It is a sql server, sybase, mysql, postgre etc.?
sql server doesn't run on unix
|
|
|
|
|
Thanks for reply..
its mysql... do i need to do anything extra to connect unix box...for database access
vikas da
|
|
|
|
|
No, all you have to do is follow the link Luc Pattyn posted, so that you get the correct connection string. (Don't know if you need a client library for mysql at the client).
|
|
|
|