|
A List<T> where T implements IComparable<T> is the best one because it has flexibility in that
you can provide custom IComparer(s) when calling the .Sort() method.
Sure a Dictionary<key,value> is faster but just like the SortedList you can only sort/search based on the key.
|
|
|
|
|
Hi All,
I am using a query i.e."select max(empcode) as code from demotable"
it was giving a value in sqlserver,but i want to implement it in c#.net by using the code. can any one help me plz...
Regards,
Basha.
|
|
|
|
|
add System.Data.SqlClient namespace
1. Open SQL connection
2. Call SqlCommand member for your query!
3. Read your value by DataReader "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How can i auto star my programs when windows start up?!
i know 2 ways that maybe not work well sometimes!
i can make a shortcut of my program in start up folder
i can make a registry value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
but sometimes viruses dont allow this methods work well
anybody know how can i make a start up program with any other ways???
|
|
|
|
|
you can develop a windows service that autostart your program when windows start.
|
|
|
|
|
Masterhame wrote: but sometimes viruses dont allow this methods work well
then make sure you don't have viruses; don't change your code for this reason!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Masterhame wrote: anybody know how can i make a start up program with any other ways???
these are generally expected two ways to starting desktop based application. If your tech lead allows you to change framework, you can also utilize services of WINDOW Service as told by Mr. Dudeja! "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
The easiest way is to make it a Windows Scheduled Task.
|
|
|
|
|
HI.. This is my backup query.. its not workin
Pls send me wat's the error in this query and how to get backup database..
alter PROCEDURE [dbo].[sp_BackupDatabase]
@databasename varchar(32),
@path varchar(256),
@filename varchar(64)AS
set nocount on
declare @sql varchar(4000)
select @sql ='BACKUP DATABASE ' + ltrim(rtrim( @databasename ))
select @sql = @sql +'TO DISK = ''' + ltrim(rtrim(@path)) + ltrim(rtrim(@filename)) + ''' '
select @sql = @sql +'WITH INIT'
print @sql
execute ( @sql )
select 'Database successfully backed up!' [Result]
|
|
|
|
|
Hi. I am getting data from a MySql Datasource like this:
string hostname = "localhost";
string username = "root";
string password = "0000";
string mySelectQuery = "SELECT * FROM report;";
MySqlConnection myConnection = new MySqlConnection("server=" + hostname + ";uid=" + username + ";pwd=" + password + ";database=elearning;Charset=latin1;");
MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection);
chart1.DataSource = myCommand;
chart1.Series["Series 1"].XValueMember = "ExamNumber";
chart1.Series["Series 1"].YValueMembers = "Percentage";
chart1.DataBind();
I am using the chart control. I got yesterday so probably i should return it before the warranty expires . There is no error but the chart just won't show when i run the application. What could be wrong.Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Wamuti wrote: I am using the chart control. I got yesterday
so ask your question where veer you got the control from.
you did not even tell us which chart control it is, how could we help you at all?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
how to convert (or Cast) string to C# classess
|
|
|
|
|
Hi,
I'm not sure what you mean exactly. Do you want to create an object from your string by deserialization? If yes, take a look here:
Object Serialization using C#[^]
If not please let me know the C# class you want to convert your string to.
Regards
Sebastian
|
|
|
|
|
I want to convert string to (Point,Font,Color,... ) ?
|
|
|
|
|
Okay, and how does the string look like? E.g. Point(10,20)? I guess you have to write your own method of converting the string to an object.
|
|
|
|
|
no it looks like
10,20
for font :
Arial
for location :
15,19
|
|
|
|
|
And where does the data come from? I mean it could be very difficult to build an algorithm analysing the string itself it is a location or a font name or a color. This could end up in writing a compiler...
|
|
|
|
|
jojoba2010 wrote: Point
System.Drawing.PointConverter
jojoba2010 wrote: Font
System.Drawing.FontConverter
jojoba2010 wrote: Color
System.Drawing.ColorConverter
|
|
|
|
|
looks like you need xml deserialization. That is, having an object represented as an xml string, deserialize it in the proper class.
Is that the case?Best regards,
Jaime.
|
|
|
|
|
No
I have string and want to cast it to (color,point,font,...)
|
|
|
|
|
jojoba2010 wrote: I have string and want to cast it to (color,point,font,...)
You cannot do this, a string is just a collection of characters. If you want to create some other object from it then you need to parse the string, extracting the relevant fields and create new objects based on that data.
Read the documentation on what casting is, it does not convert one object to another.MVP 2010 - are they mad?
|
|
|
|
|
Richard MacCutchan wrote: MVP 2010 - are they mad?
Nope i don't think so! "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You are too kind my friend. MVP 2010 - are they mad?
|
|
|
|
|
what actuallly coming into your string! "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
From what I read in the thread you're not really helpful in providing information.
Note that we don't have any background on what you need to do or what you've done so far.
Please elaborate a little on the problem. Where does the input come from? In what format is it set (XML, flat file, CSV,...)? Is there metadata included? What different types of 'classes' are we talking about? etc...
If you want help you'll need to be more specific.V.
|
|
|
|