|
Yes i am new to xml and serialization is a much better way than i was doing. Thanks again
|
|
|
|
|
you may also want to look at vtd-xml
http://vtd-xml.sf.net
|
|
|
|
|
hi friends!
i have little prob i u can plz help me.
Q.1 I have to enter login and logout time in database in SQL through c# the prob is everytime i try to do it ,it goes in two diff rows is there any other way tht i can feed it in same row n later find total used time?????
Q.2 how to display time coz using DateTime.Now.TimeOfDay.ToString() gives me time in miliseconds bt i want it only till minutes?
plz help me guys.......
|
|
|
|
|
Q.1 doesn't make much sense. If you need to start both the sign-in and sign-out times in a single row, then your row will need 3 column values:
-An ID: e.g. some unique value identifying the row.
-The sign-in time
-A nullable sign-out time.
When you first sign in, create a new row with a new ID, the sign-in time, and a null sign-out time. When you sign out, find that row by the unique ID and update it's sign-out time.
Q.2 Sounds like you're looking for DateTime.Now.ToShortTimeString() .
|
|
|
|
|
thanks friend it worked though the first one still not perfect thanks
|
|
|
|
|
I have an array of some odd 100k 3d points. I want to rotate them around an axis. What is the quickest way of rotating them? I suspect that it might have something to do with a matrix, but I dont know much about them.
Thanks,
|
|
|
|
|
Yes, matrices are what you need to look into. Are you using XNA? MSDN describes the XNA Matrix class[^]. See the links in the article for How-To's on how to transform (e.g. move, rotate, etc.) 3d points using matrices.
|
|
|
|
|
No I am not using XNA, or WPF. All I really have is a custom structure made up of three double values to define a 3d point. I see that there is a matrix class in c#. And in actuallity I would be fine even with a 2d rotation, though 3d would obviously be better.
|
|
|
|
|
GreenGiant83 wrote: I would be fine even with a 2d rotation
Check out System.Drawing.Drawing2d.Matrix class. There are other classes in the Drawing2d namespace that may help you with your rotations.
Alternately, you *could* use the free Lutz Reflector[^] tool to see how XNA's Matrix class rotates 3d rotations, then do a little copy & paste job into your own code.
|
|
|
|
|
I have found lots of articles explaining how to use the matrix class to do rotation with GDI+ stuff, the problem is that the GDI stuff takes the matrix and processes it. As I am not wanting to rotate graphics, but the actual data points themselves these articles do not help me much. Can anyone shoe me or point me to an article that can show me how to several points and rotate them, matrix math or otherwise?
Thanks,
|
|
|
|
|
I mentioned reverse-engineering XNA's Matrix class and seeing the multiplications done to the 3d points (a struct in XNA called Vector3). You should do this and look at the methods on there, such as Matrix.CreateRotationX, .CreateRotationY, .CreateRotationZ. See how those methods are applying rotation to 3d points, then you can implement a similar solution on your end.
If you're curious about how matrices work from a mathematics perspective, see Wikipedia's article on matrix multiplication[^].
|
|
|
|
|
Hi all
I'm totaling up a list of items in a Binding source and I am just having a small problem with syntax for incrementing the value of a key if it already exists
any help is greatly appreciated line 16 below
[code]SortedList mySortedList = new SortedList();
foreach (DataRowView view in myBindingSource)
{
if ((string)view["group_name"] == "USAT-Desktop")
{
view["group_name"] = "TEST TEST";
}
if (mySortedList.Contains(view["category_name"])== false)
{
mySortedList.Add(view["category_name"], 1);
}
else
{
//how do I ++ the value of the key if it already exists?
//mysortedlist[view["category_name"]].value +=1?
}[/code]
|
|
|
|
|
Hi,
mysortedlist[view["category_name"]] = 1+(int)mysortedlist[view["category_name"]];
should do it.
BTW: the above code line was set inside <pre> </pre> tags;
they work much better than [code] [/code] !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I'll give it a try
sorry about the tags I always forget going from form to form this one is a little different
|
|
|
|
|
that works great I just tried it
thanks so much I was close but I don't think I would have gotten that for a while
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Someone else suggested this solution
private SortedList<string, int> getTotals(BindingSource BS, string column)
{
SortedList<string, int> list = new SortedList<string, int>();
string name;
foreach (DataRowView row in BS)
{
name = (string)row[column];
if (list.ContainsKey(name))
{
list[name]++;
}
else
{
list.Add(name, 1);
}
}
return list;
}
Side thought
is there an easy way to "strip" the key values into an array that i could feed a combobox?
|
|
|
|
|
Hi,
if you have .NET 2.0 or better, you can use generics such as SortedList<string,int>
and that should allow you to do list[name]++;
so it gives you the same base idea, a more readable source, and it eliminates the
need to cast to int, so it does save some CPU cycles.
I trust that is what you meant, but if so the HTML eater has swallowed it.
list.Keys is the collection that holds all the key values, I guess you could feed it directly
into a ComboBox through its DataSource property.
If you need to know more, please read up on it either on your local MSDN that came with
Visual Studio, or on http://msdn2.microsoft.com[^]
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi all.
I have an application which reads a msmq path from the config file and passes to an storedprocedure.The entry in config file is as follows
<add key="XMLMSMQRecievePath" value="FormatName:DIRECT=OS:TESTCLUSTER\Private$\Sports-XML-IN\xmlcache">
Now i am storing it a string variable called "XMLMSMQRecievePath" and passed to the storedprocedure name "UpdateAuditLogDetails"
using folowing stmts
daUpdateAuditLogDetails.SelectCommand.Parameters["@XMLMSMQRecievePath"].Value = XMLMSMQRecievePath;
daUpdateAuditLogDetails.Fill(dsUpdateAuditLogDetails, "UpdateAuditLogDetails");
but i am getting the error as following
Error, Number = 0x10001165, Source = \"MSMQQueueInfo\", Desc = \"The specified format name is invalid. \""}
My storeed procedure accepts a varchar of size 2000 for it,Can any one help me on this
Regards
DilipRam
|
|
|
|
|
I think "XMLMSMQRecie vePath" is spelled wrong, but I'm just guessing.
|
|
|
|
|
Hi
No its not any thing realted with spelling...
Regards
DilipRam
|
|
|
|
|
i have two homework:
the first homework :when i use Directory.GetCurrentDirectory(),it return current dirrector is debug directory
the second one:it return Release Directory
I don't understand when return Realeas and When return Debug
please help me
thanks
|
|
|
|
|
Actually GetCurrentDirectory Method returns the last directory used in your application
Obviously when you call it at first you will get the executable path directory so if you set the build mode to Debug it will give you the Debug path and if you set it to Release mode it will give you Release path.
and if you browse another path in your program you will have it if you call GetCurrentDirectory method
hope the post help
|
|
|
|
|
If you build your application under the Debug configuration in Visual Studio (or just hit F5 to start the app under the debugger), it will use the Debug directory. If you build your app using the Release configuration in Visual Studio, it will use the Release directory. Simply put, that's where the built .exe goes when you build your application.
|
|
|
|
|
Hi All,
I have a listview with two columns and in my first column i m creating a textbox when i double click the listviewitem.And i have context menu for listview by which when there is any item selected and i press Del it will delete the selected item .Now , when i m in textbox and i write something and press to Del to delete a character it deletes the listviewitem while i want to delete only the character.
How can i fix it , please give me some help.
Thanx.
Praveen Sharma
|
|
|
|