|
Ranger49 wrote: Why do get get a new form each time I create a new instance?
Your new instance of DrawGraph1 or DrawGraph2 is a Form1 (which I expect is a Form ). What else would you expect to happen when you instantiate a DrawGraph1 or DrawGraph2 ?
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: Your new instance of DrawGraph1 or DrawGraph2 is a Form1 (which I expect is a Form). What else would you expect to happen when you instantiate a DrawGraph1 or DrawGraph2?
My problem here was that I couldn't get my subclasses to work if I didn't put a ': Form' behind the class DrawGraph :
So when my DrawGraph class doesn't inherit from Form1 that then there wouldn't be a new window opened at each new instance of DrawGraph?
Ranger...
Beginner
|
|
|
|
|
Ranger49 wrote: So when my DrawGraph class doesn't inherit from Form1 that then there wouldn't be a new window opened at each new instance of DrawGraph?
Correct.
/ravi
|
|
|
|
|
Hello!
Again I am getting the error message "member names cannot be the same as their enclosing type"
I have a class Matrix which is public. And I am wondering if C# lets a class like Project return a Matrix as it is instanced.
Last time I had this problem it had to do with certain variables not being public. But in this example there are so few variables that I figure I got all my bases covered.
What did I overlook or forget to consider?
Ranger...
public class Project
{
// Project: member names cannot be the same as their enclosing type
public Matrix Project(double Rx, double Ry, double distance)
{
return new Matrix
(
Math.Cos(Ry),
0.0,
Math.Sin(Ry),
0.0,
Math.Sin(Ry) * Math.Cos(Rx),
Math.Cos(Rx),
-Math.Cos(Rx) * Math.Sin(Rx),
0.0,
0.0,
0.0,
0.0,
0.0,
(Math.Sin(Ry) * Math.Cos(Rx)) / distance,
-Math.Sin(Rx) / distance,
-(Math.Cos(Ry) * Math.Cos(Rx)) / distance,
1.0
);
}
Beginner
|
|
|
|
|
Ranger49 wrote: What did I overlook or forget to consider?
I think it's complaining that the Project class can't have a property or method called Project .
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: I think it's complaining that the Project class can't have a property or method called Project.
I know, but why? I mean to create a new instance of a class you make a method with the same name as the class right? This should work...
Ranger...
As it is this code source went from about 1.75 page to almost 4 pages and this was the only error I got. It is my inexperience that I don't know why this is.
|
|
|
|
|
Ranger49 wrote: I mean to create a new instance of a class you make a method with the same name as the class right?
Correct. That method (the constructor) is never specified with a return type. You're attempting to define a constructor for Project that returns a Matrix .
I recommend renaming the method to CreateMatrix() or something similar.
/ravi
|
|
|
|
|
Ravi Bhavnani wrote: Correct. That method (the constructor) is never specified with a return type. You're attempting to define a constructor for Project that returns a Matrix.
I recommend renaming the method to CreateMatrix() or something similar.
I thought that could be the reason.
Thanks, I will try that!
Ranger...
|
|
|
|
|
Ranger49 wrote: I recommend renaming the method to CreateMatrix() or something similar.
I tried your suggestion and it works now!
Thank you.
Ranger...
Beginner
|
|
|
|
|
After moving this method from its own class to the Matrix class, I then made a second Matrix instance method which uses as input the arguments of the former 'CreateMatrix' method, and this works too! I find it nice to have only one method to call for new and with its own arguments.
I find C# very interesting. And I am thanking you Ravi for your assistance.
Ranger...
Beginner.
|
|
|
|
|
Glad you got it to work!
/ravi
|
|
|
|
|
Hi all,
Greetings. I've generated dynamic link button in GridView Column. When i clicks on the link button,there is no click event takes place. instead the link button disappears. Can any one of you Give me the soultion for this issue.
Thanks in Advance
Babu
|
|
|
|
|
Hello
How can I get the Process that uses a particular file?
I realy can't get this!
Thanks for input
Joel
|
|
|
|
|
Hello Joel,
I don't think there is a way to find that out.
I have the same problem right now in my application.
But I found out, that I have to be carefull by starting Processes in my Application.
Maybe if you discribe your aplication and your problem, we could find a solution.
All the best,
Martin
|
|
|
|
|
I have never seen a path from a file (or some other resource) to its current holder.
And that is unfortunate, I know those annoying "cant do that, file is in use" messages.
One way to maybe find the problem is in using some utility (e.g. TaskInfo) that
is able to list the files and the handles for any single process.
Luc Pattyn
|
|
|
|
|
Thanks for the answers you two!
Especially for the name of that program!
I already doubted if it'd be possible to get the information anyway.
But now that I know it is, I'd wonder how this program does this?
I'd be very thankful only for an approach how to code a routine that gets this information.
Thanks in advance
Joel
|
|
|
|
|
i don't know what all a web service can do, I know it can return data via XML but i am wondering if I can create a logon and encrypt a zip file for download? or would this just be better to create an ASP page to do this?
Thanks
|
|
|
|
|
A web service can provide any service you desire. The convention is to exchange data via SOAP.
/ravi
|
|
|
|
|
Hi everybody
I have used a datagrid in my form. and every thing is Ok.
I can see the items I want in datagrid but the problem is about paging.
I have set the paging to 5 ..it means the datagrid should show 5 items in page 1 and the next 5 items in the next page( page 2 ) and ...
but it doesnt work ... it shows the page but when I click on page 2 it already shows the items in page 1 ...
I mean just page 1 works ...what should I do?
whats wrong with properties or code?
please tell me ...
thank you very much.
here is asection of my code :
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
FillDataGrid();
}
}
private void FillDataGrid()
{
cUpload upload=new cUpload();
bool Success;
dsUpload1=upload.GetAllUpload(out Success);
if(Success)
{
dgUpLoad.DataSource=dsUpload1.tblUpLoad;
}
dgUpLoad.DataBind();
}
|
|
|
|
|
You haven't handled the PageIndexChanged event.
DataGrid1.CurrentPageIndex = e.NewPageIndex
|
|
|
|
|
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MSAccess manually.
What i am aware of is that i cant just read the field containing the Excel File into a Byte Array and pass it to the Excel object in C#,as the file is wrapped in the OLE Wrapper used by Access while inserting the file in database.
I have tried locating the Header of Excel file from the byte array and read the file from there on but it is not working.
Can some one please tell me as to how i can open the Excel File.
|
|
|
|
|
Hi people,
i removed my code from my code behind and placed them inline but have problem with the code bcos I don't know how to figure it out.
Using System;
Using System.Data.SqlClient;
.
.
.
but I am getting "INVALID TOKEN 'USING IN CLASS STRUCT, OR INTERFACE MEMBER DECLARATION"
please tell me how to fix it.
thak y a all
|
|
|
|
|
Change "Using" to "using".
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi they are all in smaller u and still gives the same problem.
|
|
|
|
|
You said you are using inline. Try it this way and see if this gets rid of your error
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.oledb" %>
<script runat="server">
Zach
|
|
|
|