|
pasztorpisti wrote: read a list of reasonings about that somewhere
Indeed - it's not a feature I missed when I moved over from C++ to C#. Now, if C# supported proper templates, I would be happy.
|
|
|
|
|
What features would you like to have from C++ templates? I think they are overcomplicated, and since the C++ specification describes just how they should work - and nothing about implementation - different C++ compilers handle them differently. I could tell you at least 2 big horror stories about this (one bug and one source code porting).
|
|
|
|
|
pasztorpisti wrote: the C++ specification describes just how they should work - and nothing about
implementation - different C++ compilers handle them differently
The key thing would be that .NET is standardised, so there would be no ambiguity. Some things I'd like - arithmetic operator overloading, explicit and partial specialisation.
|
|
|
|
|
The arithmetic part is indeed a huge problem in C#. About the template specialization: I think they are rarely used in C++ and even in those cases I've often use of it without good reason. A nice use of it is optimization like std::vector<bool> with packed bits, or code beautification. In other cases where it was used some other simpler solution could also do the job for me.
|
|
|
|
|
To answer your original question
Himanshu Yadav wrote: Re: WHY GIRLS DONT LIKE TO MARRY SOFTWARE ENGINEERS ?????
They must have read your posts. You might try posting anonymously though.
|
|
|
|
|
You made my day.
|
|
|
|
|
There's a reason most modern languages don't support multiple inheritance.
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
Instant C# - VB to C# Converter
Instant VB - C# to VB Converter
|
|
|
|
|
Himanshu Yadav wrote: Why c# do not support Multiple Inheritance
Why do you think it matters?
|
|
|
|
|
My opinion: Because multiple inheritance brings some problems to the langauge and its easier to go with single line inheritance and multiple interfaces. As an example I would mention C++ that supports multiple inheritance but has no interfaces. Because of this sometimes it occurs that you are forced to use virtual inheritance that usually isn't a clean solution compared to single line inheritance + interfaces. My experience is that virtual inheritance is avoided in C++ whenever possible because noone likes it. Besides that multiple inheritance can come handy but doesn't add more than the single line inheritance+interfaces solution that is automatically immune to virtual inheritance problems. Google "virtual inheritance" to find out more about this problem.
|
|
|
|
|
In contrast to some "experts" here on CP, I worked with a language which supports multiple inheritance: C++ (i.e. non-managed C++). Hence I think that your question is an appropriate question, it does not deserve downvoting.
Let me give you an example which shows where multiple inheritance is a pain. Imagine two base classes which have a function with the same name.
public class FirstClass
{
public virtual void DoSomething()
{
}
}
and
public class SecondClass
{
public virtual void DoSomething()
{
}
}
When you create a class inheriting from both of these classes
public class CombinedClass: FirstClass, SecondClass
{
}
it inherits the DoSomething() method from both FirstClass and SecondClass .
When you call DoSomething() on an instance of CombinedClass
CombinedClass c = new CombinedClass();
c.DoSomething()
which of the DoSomething() methods do you call - FirstClass.DoSomething() or SecondClass.DoSomething() ?
Other object oriented languages may offer more features which are not supported in the .Net world, e.g. inheritance of static functions and properties.
|
|
|
|
|
I like your example and way of thinking great!!!!
Thanks
|
|
|
|
|
Question and Scenario: We have N number of users using this utility to back up multiple DB's(consider 5 selected by a user) from a server.From the above code this will only execute serialy one after the other for each user. Instead of this , selected 5 db back up operation should process parallel and the control should come out accepting the request from the next user
Could anybody suggest the best approach that will provide the best perfomance
We have code written need to back up and restore database using LiteSpeed extended procedures
=====================================
<pre lang="c#">public bool ArchieveDB(string serverName, string databaseName)
{
try
{
string fileName = ATTACH_FILE_PATH + databaseName + ".BAK";
SqlParameter[] dbParameters = new SqlParameter[]
{
new SqlParameter {ParameterName =SERVER_NAME, Value = serverName },
new SqlParameter {ParameterName =DATABASE_NAME, Value = databaseName },
new SqlParameter {ParameterName =FILE_NAME, Value = fileName },
new SqlParameter {ParameterName = INIT_VALUE, Value = 1}
};
ExecuteNonQuery(BACKUP_SP_NAME, dbParameters); return true;
}
catch (SqlException ex)
{
return false;
}
}
|
|
|
|
|
Create multiple threads, each thread has it's own connection over which it executes its backup operation. You may need to turn pooling off on your connections.
I would be wary of this, 5 backup operations running simultaneously on 1 server will affect performance!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Not considering the performance implications of running 5 backup operations concurrently (which would involve heavy disk read/write operations), I would suggest:
1. Use the Thread class
2. Use ThreadPool
3. Use a BackgroundWorker
4. Use Task Parallel Library
|
|
|
|
|
Hey guys,i am having trouble with my application in terms of clearing textboxes when i change my tabs.i have one tabcontainer with 3 tabs namely "Create" "update" "Delete" in my tabcontainer1 .the code i tried:
protected void tabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
if (tabContainer1.ActiveTabIndex == 0)
{
txtCompanyname.text="";
}
am i doing something wrong?
also 1 more problem i have is that my gridview is stretching out of my page,any way around this guys?
Thanks
|
|
|
|
|
HimalR8 wrote: am i doing something wrong?
Yes. You should have posted this in the ASP.NET forum, where the ASP.NET experts are.
Also, if they are Ajax tabs, aren't the events happening on the client and not the server?
|
|
|
|
|
Oops sorry.will move it too the asp.net forum.New here and new to programming.
Thanks
|
|
|
|
|
Not a problem. Welcome to the forums - as I deal primarily in desktop development, I tend to steer ASP.NET questions to that forum because the people who answer there are generally very clued up.
|
|
|
|
|
Hey.. I am developing an windows form application using ms sql server 2008. and i want to connect my sql server to cloud at internet to use it as backup. if there is any changes made bu application in local server then it should be reflected on cloud also. and if there is any loss of data at local server then it should get backup automatically from cloud.
Can someone help me in this please.. ??
|
|
|
|
|
KUNWAR999 wrote: Can someone help me in this please.. ??
The cloud provider I bet.
You need to have rights on their server, I don't know if the give you access for your server to connect to their, but if they do, they can tell you more about.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
I have a database on cloud.. as for backup.. i just want to connect my sql server to that database though c
# coding.. help here pls..
|
|
|
|
|
|
hey sorry.. i think you get me wrong.. i want to connect mssql server 2008 to cloud ,.. not my application to mssql2008.. i have already done that.. now i want to connect local server which is mssql 2008 to cloud database. thanx for your try.. but hope you understand my question now..
|
|
|
|
|
Then it's the wrong board. In this board we are discussing C# programming and not SQL-Server to Cloud connection.
You should go to the database board.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Looks like you need to investigate the Microsoft Sync Framework. Details here[^].
|
|
|
|