|
Software2007 wrote:
Are you saying learning C# is a disadvantage?
Could be.
For example
- Using TCP in C++ will require learning more about that versus C#.
- One is more likely to learn about how the OS manages memory if one uses C++.
- One is more likely to learn about how the OS manages other types of resources if one uses C++.
Doesn't mean that one will not learn those with C# but rather that it is more likely that with C++ will need to learn about those in detail.
|
|
|
|
|
Hello
I am calling a piece of code in all my aspx.cs pages, which is like an error trapping class.
Can I create an actual class, and then include this class in my aspx.cs pages, so if I do have a change I can make this change in one place, in this one class instead of all my aspx.cs pages?
How would I go to call this class?
I was able to create a stand alone class but how to include in my aspx.cs pages?
Thanks!
|
|
|
|
|
Inheritance will solve your problem. You create a base page based on the built-in Page object:
public abstract class MyPageBase : System.Web.UI.Page {
}
Then in your codebehind files, you can inherit from the class:
public partial class DefaultPage : MyPageBase {
}
|
|
|
|
|
If you are really trying to implent a top-level exception handler to trap all errors,
you might like to use the Application_Error method in Global.asax. There is an whole knowledge base article about it here[^]. This has the added advantage of trapping some extra [mostly unlikely] errors.
In all other cases Matt Meyer's answer is excellent.
[Edit]
Replaced bizzare language with a more commonly used one called English, and changed the content so it says what I mean rather than simply meaining what I say. </Idiotness>
|
|
|
|
|
I have 2 list collections as below
List1
115
100
150
List2
115
100
now i need to check both of above list and need to get answer for matched ,
for example :
115
100
both matched, i need to achieve this how can i do it ?
|
|
|
|
|
C# 3.5? list1.Intersect(list2)[^] (it's an extension method in System.Linq)
If not, it's trivial to produce a naive implementation which will be fine for small lists:
IList<T> Intersection<T>(ICollection<T> one, ICollection<T> two){
IList<T> r = new List<T>();
foreach(T t in one)
if(two.Contains(t)) r.Add(t);
return r;
}
|
|
|
|
|
You've been around long enough to know and understand the forum guidelines. DON'T REPOST. You asked this same question four hours ago in the C# forum, it has nothing to do with ASP.NET. If you didn't receive an answer, wait. Don't repost.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I think he should delete the other one, not this one, though. C# forum is the correct place for it, the other one is misplaced (and I didn't see it there since I don't read the ASP.NET forum ).
|
|
|
|
|
Consider using HashSet instead.
|
|
|
|
|
hiiii
iam working on c# windows application
i always use grid just for dir select only
i have issue where i need to add/edit/delete from gridview & dir combobox & Datetimepicker on my cells when i click on it and after leave it dir the selected value in grid cell
i need any help
thanks
md_refay
|
|
|
|
|
hiii
iam working on windows # Application
i need to upload files to server & download it like asp.net
but i don't know how
i need your help
md_refay
|
|
|
|
|
|
hello Dave help me......
u know about my problem
project not run on vista with amd processor
exception occured on form's InitializeComponent() method.
and run on vista with intel processor....
after installig visual studio it work fine on vista with amd processor.
if u require any other info then let me know.......
thank u
|
|
|
|
|
Please don't post messages addressed to random members like this. Add it to the original thread you started here[^].
The best things in life are not things.
|
|
|
|
|
|
I would be willing to be that you need to update your .net install.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "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
|
|
|
|
|
I've looked all over the internet for a formula to calculate the start angle and end angle of an arc. It's very awkward since the angles go in a clockwise motion. The parameters I have are, (X1, Y1), (X2, Y2), ArcCenter, Radius. I'm pretty sure the calculation uses Atan2 as I have tried to figure it out myself.
Thanks
|
|
|
|
|
Start angle = atan2(y1-yc, x1-xc)
End angle = atan2(y2-yc, x2-xc)
... with (xc,yc) being the centre point.
If that isn't right, try switching the parameters or putting minus signs in. That will give you an arc but I'm not sure where it starts from.
Specifying the radius is not necessary if you specify the three points explicitly.
|
|
|
|
|
hello guys... I am trying to get my first crystal report printed but seems to be having a problem I am unable to trace. I added a report to my (Windows Form) project, then added the dataset to it and finally added the following code. This does not show any error but does not show data either. Here is what I tried
private void Form1_Load(object sender, EventArgs e)
{
CrystalReportViewer crv = new CrystalReportViewer();
string ConnString = "Data Source=srv032k3; Initial Catalog= MuzeDB; User ID=muze; Password=saeedasd";
string query = "SELECT * FROM students";
try
{
SqlConnection conn = new SqlConnection(ConnString);
SqlDataAdapter da = new SqlDataAdapter(query, ConnString);
DataSet ds1 = new DataSet();
da.Fill(ds1, "students");
rpt.Load("D:\\Projects\\CrystalReportsApp\\Report\\StudentsReport.rpt");
rpt.SetDataSource(ds1);
crystalReportViewer1.ReportSource = rpt;
}
catch (Exception ex)
{
MessageBox.Show("Something went wrong: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
|
|
|
|
|
I think your problem is here
SqlConnection conn = new SqlConnection(ConnString);
SqlDataAdapter da = new SqlDataAdapter(query, ConnString);
I think it should be
SqlConnection conn = new SqlConnection(ConnString);
conn.open;
SqlDataAdapter da = new SqlDataAdapter(query, conn);
|
|
|
|
|
A mistake that should not have been made. But still the problem is not resolved.
|
|
|
|
|
overloaded Name wrote: but does not show data either.
That is rather indefinite.
I am guessing that you mean that it doesn't show anything at all.
The reason I think that is that I googled for examples.
And one of the shows the use of the 'Visible' property which is a property of the parent of that class. The description of that suggests that it must be true for display to occur.
|
|
|
|
|
Hey everybody.
I have a very small trouble...
List view double click event is getting invoked if I am doing double click on its scroll bar.
How to avoid this...
Thanks in advance..
--
CHEERS
|
|
|
|
|
what are the features of row docking. is it something like data rows on top and stay on their fixed positions. If so how we can use it.
|
|
|
|
|
Is this a feature that the user has asked for? If so, why not ask them what they mean by this? It could mean 2 or 3 things, so it's best to find out out what your users think as it's them you should be satisfying.
|
|
|
|