|
Ashfield wrote: when you are extracting a subset of data to a file for any reason
Including when I only want a subset of the columns?
|
|
|
|
|
Not really, I was replying t a cmment that said NEVER use select *
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You realise how legacy the "never select *" rule is right? Back in SQL 7 (circa 1997), it caused an extra round trip to the server to determine the table schema before doing the actual data select. By SQL 2000 they had fixed this issue and it ceased to be a problem.
As far as good practice goes, I totally agree with you. As far as a bolded+uppercase NEVER goes, sorry, you're wrong.
|
|
|
|
|
J4amieC wrote: circa 1997
I was 9 back then
Its just a practice i was taught and it stuck, and if these newbies get used to SELECT * FROM and they one day work on or with big databases (like the systems you'll come across at the data warehouse of an insurance company) they will bring it down! Ive heard about things like this being common from my step mom who's a data modeler.
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Harvey Saayman wrote: I was 9 back then
I know you were, ow stop making me feel old!
Harvey Saayman wrote: they will bring it down
bring it down how? Essentially nowdays Select * is identical to select col1,col2...
|
|
|
|
|
J4amieC wrote: I know you were, now stop making me feel old!
bwhahahaha, sorry...
J4amieC wrote: bring it down how?
SELECT *
FROM table1
JOIN table2
ON someCondition
JOIN table3
ON someOtherCondition
If you pull that kinda crap (and sadly it happens) on DB's containing terra's upon terra's of data...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Ok, I see your point, but its not the * thats the issue its the pulling of all fields from a large query. Someone stupid enough to do that would follow your advice and just write:
SELECT [very long list of column names]
FROM table1
JOIN table2
ON someCondition
JOIN table3
ON someOtherCondition
Now leave me in peace you little whipper-snapper.
|
|
|
|
|
J4amieC wrote: Now leave me in peace you little whipper-snapper.
lol, i had to go google [define:"whipper snapper"]
cheers bud
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
damn, after doing that it soudsn kinda insulting. I didn't mean it that way.
|
|
|
|
|
its all good, didn't think you did
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi
Can any one tell me how to run a exectuable by windows service?
I tried through process.start(), but no use.
I am using Admin user to run this service.
I am struck up with this...
Thanks for the help in advance.
|
|
|
|
|
Services run on their own desktop so if you start a program from service it will start on that desktop and not at the desktop you are looking at
|
|
|
|
|
Hi
I am not sure whether i have posted the requirement correctly.
Any how i will try to make it clear.
1. I am having a EXE in the application folder.
2. I have a windows service through which i want to run the exe available in the application folder.
Am i clear now..........
|
|
|
|
|
Yes, it is clear. Same reply applies here. When starting an executable from service it runs on another desktop.
|
|
|
|
|
Ummmm, no.
If he sets up his Process object correctly, he can run an external application.
"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
|
|
|
|
|
Try setting the service's Allow service to interact with desktop option to true in the services applet.
Be warned that this is very bad practice.
Cheers,
Vıkram.
"if abusing me makes you a credible then i better give u the chance which didnt get in real" - Adnan Siddiqi.
|
|
|
|
|
|
Thanks, my Georgian friend, I didn't know that.
Can't figure out the lynch votes though.
Cheers,
Vıkram.
"if abusing me makes you a credible then i better give u the chance which didnt get in real" - Adnan Siddiqi.
|
|
|
|
|
You have to provide a lot more info before we have any hope of assisting you.
1) Can you run the application manually?
2) How are you setting up your Process object?
"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
|
|
|
|
|
I m coding primative Asynchron calling.
How could i set timeout property to iasyncruslt or my beginxxxasync calls?
|
|
|
|
|
Hi,
I try deverlop source code which can coonect to Camera and get Image from
this camera. In code when I click button capture Image.It have error.
///////////This is My code//////////////////
string sourceURL = "http://192.168.1.4/snapshot.jpg?account=admin& password=12345678&res=0&qual=50";
byte[] buffer = new byte[100000];
int read, total = 0;
// create HTTP request
HttpWebRequest req = (HttpWebRequest) WebRequest.Create( sourceURL );
// get response
WebResponse resp = req.GetResponse( );
// get response stream
Stream stream = resp.GetResponseStream( );
// read data from stream
while ( ( read = stream.Read( buffer, total, 1000 ) ) != 0 )
{
total += read;
}
// get bitmap
Bitmap bmp = (Bitmap) Bitmap.FromStream(
new MemoryStream( buffer, 0, total ) );
////////////////End code
Problem is this line:
Bitmap bmp = (Bitmap) Bitmap.FromStream(
new MemoryStream( buffer, 0, total ) );
it have error message:"Invalid parameter used"
Please help me.
thanks
|
|
|
|
|
erm...why do you need to create a stream from a buffer from a stream?
The original stream wasn't good enough?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Below is the skeleton code which demonstrates the way I have used the BackgroundWorker class. I followed the example provided in MSDN. For some reason MyTimeConsumingTask executes twice before the bgWorker_RunWorkerCompleted handles it.
Any help would be greatly appriciated.
void bgWorker_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
e.Result = MyTimeConsumingTask(e.Argument, worker, e);
}
void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
}
else if ((bool)e.Result)
{
}
else
{
}
}
internal bool MyTimeConsumingTask(object arg, BackgroundWorker worker, DoWorkEventArgs e)
{
Thread.Sleep(10000);
return true;
}
|
|
|
|
|
Put break points and step into the code to see what is wrong.
|
|
|
|
|
Checked with break points at every line of code involving this event.
Although the e.result of first execution is true, the bgWorker_RunWorkerCompleted doesn't handle it but handles it after second execution. Below is the sequence of the code execution as traced by break points, strange but true...
BackgroundWorker worker = sender as BackgroundWorker;
e.Result = MyTimeConsumingTask(e.Argument, worker, e);
Thread.Sleep(10000);
return true;
BackgroundWorker worker = sender as BackgroundWorker;
e.Result = MyTimeConsumingTask(e.Argument, worker, e);
Thread.Sleep(10000);
return true;
else if ((bool)e.Result)
|
|
|
|