|
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
|
|
|
|
|
Thanks Simon,
Could you provide some keywords to make a search? I searched for "C# store procesure" and it contains just basic things like how to use store procesure in C#. Not too much materials about how SQL manages store procedure when there is large number of simultaneous calls.
regards,
George
|
|
|
|
|
Just use some common sense. SQL Stored Procedure Optimise Automatic Execution Plan Caching
George_George wrote: procesure
Start by spelling "procedure" correctly
how to google[^]
Simon
|
|
|
|
|
Hi Simon,
I did some search by the keywords you mentioned and find a lot of things. Various things, like batch execution as best practice, cache plan, store procedure optimization technologies.
I am willing to follow your suggest to find the right technology to my problem, but I have found so many. Could you just recommend me the technology name or some reference link I should use? Thanks.
regards and have a good weekend,
George
|
|
|
|
|
within or instead of the entire switch statement. i was advised that using tags are better than using the index in a switch statement. however switch only accepts integer types?
thank you in advance
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
The Tag property is of Type 'object'. If you put integers in them, cast the Tag.
Convert.ToInt32(mytextbox.Tag);
|
|
|
|
|
Hello everyone,
I have two ways to define the constructor of my exception class, which is derived from ApplicationException class.
I am not sure the pros and cons of the two constructor definitions? Any comments or advice?
class MyException : System.ApplicationException
{
private int _errorCode;
private string _errorDescription;
public MyException (int errorCode, string errorMessage)
: base (errorMessage)
{
_errorCode = errorCode;
_errorDescription = errorMessage;
}
public MyException (int errorCode, string errorMessage)
{
_errorCode = errorCode;
_errorDescription = errorMessage;
}
}
thanks in advance,
George
|
|
|
|
|
The former constructor is preferred as it allows the exception's message to be accessible when the exception is treated as ApplicationException .
/ravi
|
|
|
|