|
Works fine for me. I ran it from code, and I just opened up a SQL Query in SQL Server Management Studio Express and ran it. Would you post the code you are using to execute the query? I'm looking to see if that exists in SQL 2000.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
No code...
Just by running your query on the Enterprise Manager and on the Query Analizer apps.
Maybe it's a version thing.
Danny
|
|
|
|
|
Found it on this dude's blog:
http://sqljunkies.com/WebLog/sqldude/archive/2004/06/14/3146.aspx[^]
Quoting:
Now to obtain the current number of connections to the server, you can use:
SELECT COUNT(*) AS CONNECTIONS FROM master..sysprocesses
And just to get the user connections, omitting the system processes, use:
SELECT cntr_value AS User_Connections FROM master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name = 'User Connections'
Thanks anyway.
Danny
|
|
|
|
|
Hello All,
Has anyone come across any code that will convert a set of tiff files to an avi?
Thanks.....
|
|
|
|
|
Hi all,
So I have a Bitmap field, now I want to save it to disk, BUT if it has
some transparent pixels, I want to save it as a gif, else save as
jpg.
Sounds reasonable?
How can I do that?
Thanks in advance,
Danny
|
|
|
|
|
There is no such thing a transparent pixels in a bitmap. There's only transparency support in file formats, and in code that sets bitmasks.
The png file format has transparency built in, but when you load a bitmap object it doesn't have support for transparency, it's just not part of the format.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Okay, so maybe my approach is wrong..
Situation:
The user opened an image file, and I load it to a Bitmap, but I don't know if the image has some transparent regions.
Now, regardless to the original user's image file's format, I want to save the image to disk, Image.Save (String, ImageFormat).
So if the original image had some transparent regions, I would want to use an ImageFormat that has support for transparency (png/gif), and if there were no transparent regions, I would use Jpeg.
Questions:
Does this requirement make sense?
How can I handle this kind of situation?
Thanks,
Danny
|
|
|
|
|
Hello,
I have a userControl that has a string property. I want that, instead of typing in this property, the user gets a comboBox with strings got from a database.
I've created a new class that has a GetStandardValues method, like this:
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
ArrayList permissions = new ArrayList();
permissions.Add("test1");
permissions.Add("test2");
permissions.Add("test3");
return new StandardValuesCollection(permissions);
}
When I set the typeConverter of the property at my userControl to be the type of the above class, it works. The control's property diplays the test strings in a comboBox.
But when I try to bring this strings from a dataBase, it doesn't work.
I've already tried this:
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
ArrayList permissions = DataBase.GetPermissions();
return new StandardValuesCollection(permissions);
}
Anybody has can help me?
Thanks
Peterson
|
|
|
|
|
Peterson Luiz wrote: When I set the typeConverter of the property at my userControl to be the type of the above class, it works. The control's property diplays the test strings in a comboBox.
But when I try to bring this strings from a dataBase, it doesn't work.
What do you mean "it doesn't work?" Does it throw an error, does it return nothing? When posting a question be as descriptive as possible.
Peterson Luiz wrote: I've already tried this:
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
ArrayList permissions = DataBase.GetPermissions();
return new StandardValuesCollection(permissions);
}
Anybody has can help me?
Have you tried setting a breakpoint on the return to see what the values in your permissions ArrayList ? If it doesn't throw an error, maybe you aren't returning anything from your database.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hello,
When I said it doesn't work, I get an NullReferenceException. But, if I put the same code somewhere else and try it in runtime, it works perfectly. It returns all the strings I want from the database. So, the code is right, but doesn't work in design mode, with the usercontrol.
I get the NullReferenceException at the line
ArrayList permissions = DataBase.GetPermissions();
Thanks
Peterson
|
|
|
|
|
Peterson Luiz,
I think you just answered your own question. By the sounds of it, you're trying to view information in design mode when you don't have a database connection.
Either, put the below at the top of your method to stop the method accessing the database:
If (DesignMode)<br />
return;
OR. When ever you call the object DataBase, check if its null and create a new instance.
Regards,
Gareth.
|
|
|
|
|
Hi,
How do we decide which data provider to use from ADO.NET?
How do I decide if I need to use SQLClient or Oledb data provider for my SQL Server database.
The answer that I got for this question from my collegues is that "coz SQL Client is optimized to be used for SQL Server", is that the only reason?
Regards,
Blumen
|
|
|
|
|
Hi Blumen,
Yes, the SQL set of classes are designed for SQL Server and the OleDb are for Access.
Regards,
Gareth.
|
|
|
|
|
gareth111 wrote: Yes, the SQL set of classes are designed for SQL Server and the OleDb are for Access.
OleDB uses OLE DB providers underneath which can connect to SQL Server, Access, CSV files and so on. It was not solely or optimised "for Access" as you seem to imply.
|
|
|
|
|
So whats the point in having so many data providers, ODBC for example?
|
|
|
|
|
hi ,
when any one trying to register birthdayreminder.com or some
other websites , it will ask whether to import mail id's from existing
account or entering manually.
can any one explain , how they are importing the contacts from our address book ??? and how we can do it in C#.net ..
thanks
Suman
|
|
|
|
|
That has to be one of the most annoying and insecure features ever. Who in the right mind would give their login details for their email to some website?
|
|
|
|
|
yeah, facebook does that aswell, that was point where I found the unsubscribe me from this service button
|
|
|
|
|
originSH wrote: Who in the right mind would give their login details for their email to some website?
A lot of people, that's who.
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
That is why I hate people who do the whole social networking thing, such as facebook or myspace. 95% of them are just pathetic, very un-intelligent people who are begging to be accepting and "definded" by anyone or anything. These are the people who have to add 100's of people to their "friends list," people whom they don't or barely know. They think that their MySpace page layout, graphics, and the sh*tty music they play there says a lot about their personality.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
"This world is a comedy to those that think; a tragedy to those that feel." - Horace Walpole.
I think he got it the other way round.
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
lol the answer is "an idiot" ... combined with your observation that means theres lots of idiots ... hehe so this is just another way to prove the stupidity of users
|
|
|
|
|
hi ,
if u know that procedure pls tell me how they will do that ..
thanks
|
|
|
|
|
No, I will not help people with anything that I think is illegal, unethical, or irresponsible.
|
|
|
|
|
I mean getting all IP addresses in Default Gateway in LAN...
venki
|
|
|
|