|
This is the part where we try to become mind readers. It's a zen thing.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: This is the part where we try to become mind readers. It's a zen thing.
-_- mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm Nope, not getting anything from him. I wonder why??
|
|
|
|
|
Hi guys,
I need to leave space or newline between radio button which is dynamically created but i cant do this any suggestions for ths prob.....
0-->radiobtn
0 1 0 2 0 3
I need like this,
0 1
0 2
0 3
modified on Wednesday, November 12, 2008 9:22 AM
|
|
|
|
|
Depends on your environment.
If you're in ASP.NET, just include a <br>, <p>, etc. or perhaps use a table to build up the radio buttons.
If you're in WinForms, use a TableLayoutPanel (if .NET 2.0+) or docking perhaps.
You've got many options really in either environment. Think about how you would do it statically and then build code to replicate that on the fly.
|
|
|
|
|
Set the position(X,Y) of the radio buttons on your form. Perhaps increment the Y value by 10 for each radio button created but leave the X value the same.
|
|
|
|
|
Hi All,
I have an application that builds a specialised database of certain file types. The app scans a machine and stores its information in a SqlCe database.
I also want to enable the application to detect any changes and update the database accordingly.
This is where my query lies. So far my thoughts on enabling this involve some form of hashing. So for each directory that the application adds files from it will also make a hash value from that directories filenames by concatenating all the file names and getting, for instance, an MD5 hash from that string. Then it stores that hash value against its directory in a table in the DB.
This table could then be used to drive a syncronisation process by recreating new hash values for each directory entry in the table and comparing it to the stored hash value. If they match no work is required, if not the directory and the DB need syncronising.
One other question would be what field setup in the DB would be recommended for storing these hash values?
Does this concept overall make sense?
|
|
|
|
|
Jammer wrote: Does this concept overall make sense?
Pretty much, although bear in mind, that if you only hash the filenames, you won't detect any difference if the file contents change. Is this ok for what you are trying to achieve?
If you need to monitor for contents changes too you will need to hash the whole file. Obviously, bear in mind that hashing every file and directory on a system is likely to take quite a long time.
Perhaps take a look at the
FileSystemWatcher[^] class. It allows you to be notified when changes are made to the file system. You could use this, but obviously your program would have to be running all the time to respond to the events.
Simon
|
|
|
|
|
Hi Simon,
Thanks for this.
It would be impossible for my app to monitor the contents of files as well. I'm dealing with 100,000 file data sets and this would really be overkill. Just knowing that a directory has changed is good enough at the moment.
Thanks again!
|
|
|
|
|
Jammer me old mucker. What you want to look at is the Microsoft Sync[^] Framework. Download it here[^].
|
|
|
|
|
Sh*t the bed!! Looky!!! THANK YOU!
|
|
|
|
|
Who's your daddy. Hoo yah.
|
|
|
|
|
HAHA!
|
|
|
|
|
I have two very simple report in my winform project.
Development machine is windows vista home premium, vs 2005 sp1 and crystal report sp1 for vs 2005.
I read the printer name from a config file and use that printer name in code
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
PaletteLabelPrinter is a string holding the printer name from config file.
When I deploy my app to server 2003 R2, I simple have an error for report printing if I have a different printer name at the server than at my development machine.
Crash happening right at the line
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
Error is as follows
Error in File C:\DOCUME~1\alc.......... The request could not be submitted for background processing
Besides, even though I installed the crystal report sp1, vs2005 just stop running when I select from
menu
Crystal Report -> Design -> Printer Setup, do something change and press OK then VS2005 simple
stop working.
Please help
Thanks to everybody
Muharrem
|
|
|
|
|
Use a more descriptive subject line and do not to use the word urgent. People help when they can.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
let's say i have a table in my database which corresponds to a business object. in my application i create an instane of the business object class, say, CBusinessObject. Now I want to serialize this instance to the datastore. Is the best practice creating a stored procedure with an insert clause?
again thanks in advance.
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
That would be my preference. Others may suggested parameterised queries, but I like to keep as much of the actual implementation out of my code as possible - just using a stored proc name and a list of parameters seems cleaner to me than generating a sql insert statement. Also reduces network traffic.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
There's lot of ways.
Stored procedure
Parametrized query
ORM layer (Like NHibernate, LinqToSql or the Entity Framework)
A lot of people will argue SPs are better because the server optimises them. This is not true, modern database servers cache the execution plan for normal queries just as they do for stored procedures. It pretty much comes down to personal preference between the two. (Personally I prefer parametrized queries, I find them easier to maintain than SPs, but everyone has a different opinion on this)
An ORM is likely to be slightly slower, but will give you better abstraction and you won't have to write too much DAL code. Although they often require a lot of configuration will some form of GUI or XML based tool. Sometimes you can auto generate the ORM config by pointing it the database.
Simon
|
|
|
|
|
as in the following code?
INSERT INTO dbo.MYTABLE <br />
(<br />
prikey,<br />
col1,<br />
col2,<br />
col3,<br />
col4,<br />
)<br />
VALUES <br />
(<br />
NewId(),<br />
@Param1,<br />
@Param2,<br />
@Param3,<br />
@Param4,<br />
)
i get the following error if I use NewId()
<br />
Operand type clash: uniqueidentifier is incompatible with int
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
You make the primary key an identity column, and then just dont specify it:
<br />
INSERT INTO dbo.MYTABLE<br />
(<br />
col1,<br />
col2,<br />
col3,<br />
col4,<br />
)<br />
VALUES<br />
(<br />
@Param1,<br />
@Param2,<br />
@Param3,<br />
@Param4,<br />
)
newid() generates an new GUID
|
|
|
|
|
Hi, im having some real PROBLEMS implementing this algorithm, i just cant find anywhere that explains it in a simple enough manner for me to understand, so i was wondering if anyone here could knock together a quick example for me? I've had a stab at it so far and this is what i've got:
public Hashtable FindShortestPath(string start, string end)
{
Dictionary<string, Node<T>> Q = new Dictionary<string, Node<T>>();
Hashtable distance = new Hashtable();
Hashtable route = new Hashtable();
foreach (KeyValuePair<string, Node<T>> kvp in Nodes)
{
distance.Add(kvp.Key, Int32.MaxValue);
route.Add(kvp.Key, null);
Q.Add(kvp.Key, kvp.Value);
}
distance[start] = 0;
while (Q.Count >= 0)
{
string minimumID = null;
int minvalue = Int32.MaxValue;
foreach (KeyValuePair<string, Node<T>> kvp in Q)
{
if ((int)distance[kvp.Key] < minvalue)
{
minvalue = (int)distance[kvp.Key];
minimumID = kvp.Key;
}
}
foreach (Edge<T> e in EdgeList)
{
if (e.startNode.ID == minimumID)
{
int startNodeDistance = (int)distance[minimumID];
int endNodeDistance = (int)distance[e.endNode.ID];
if (startNodeDistance + e.weight < endNodeDistance)
{
distance[e.endNode.ID] = startNodeDistance + e.weight;
route[e.endNode.ID] = minimumID;
}
}
}
Q.Remove(minimumID);
}
foreach(int k in route.Keys)
{
Console.WriteLine("k: " + route[k]);
}
return route;
Can someone tell me where im going wrong please?
Many Thanks
|
|
|
|
|
|
Hello everyone,
I am writing an API which accepts request and conver the request to call to database store procedures. There may be a lot of simultaneous requests to a store procedure (the store procedure may just query for data, or may update database). My concerns is I do not want to hit database too hard and at the same time achieve the best performance.
What is the traditional solution to this problem? Using thread pool and keep connection to database alive? Or do nothing and trust database store procedure to do its own optimization?
thanks in advance,
George
|
|
|
|
|
If your using SQL server it does it's own connection pooling. It will automatically reuse existing connections if it is optimal to do so.
Simon
|
|
|
|
|
Thanks Simon!
1.
Your suggestion is I just feel free to call SQL Server and let SQL Server itself handles large number of simultaneous call?
2.
I am interested in this topic, do you have any related documents to refer?
regards,
George
|
|
|
|
|
1. Yes.
2. No, not really. Just use google.
Simon
|
|
|
|