|
Apurva,
Thanks for the response. My problem is with windows forms not web forms. On the surface things look great. Just seems that selectedindex and text fields are not altered....
Cheers...Del
|
|
|
|
|
Hello,
I wonder if it's possible to point to a set of parameters or values when calling a function with a delegate. I have 2 forms and I pass delegate to call functions from form1.
lets say on form2 i have:
public delegate bool CallFuncDelegate();
private int generalX, general Y;
public bool Call(delegate, int a, int b)
{ generalX = a;
generalY = b;
invoke();
}
public bool Func1()
{ int localX = generalX;
int localY = generalY;
....
}
public bool Func2()
{ int localX = generalX;
int localY = generalY;
....
}
On form1 i will assign Func() to the delegate and call it thru Call():
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate, 1, 2);
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate, 8, 9);
So is there a way to call Func() in form one and at the same time tell which parameters to use in form2?
so it's gonna be like this on form2:
public delegate bool CallFuncDelegate();
setofParam1{int generalX =1; int generalY =2};
setofParam2{int generalX=8; int generalY=9};
public bool Call(delegate)
{
invoke();
}
public bool Func1()
{ int localX = setofParam1.generalX;
int localY = setofParam1.generalY;
....
}
public bool Func2()
{ int localX = setofParam2.generalX;
int localY = setofParam2.generalY;
....
}
On form1:
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate); // and then activate set1
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate);// and then activate set2
Sorry for being a little bit confusing. I want to do that because sometimes Func() can have less or more parameters and that required me to change the Call() and it's signature.
Donkaiser
|
|
|
|
|
|
Good day eveyone,
Is there anyone know how to implement Heap data structure by using ArrayList?
Or you know any sample project?
Pls help if you're interested in, thanks so much
eric
|
|
|
|
|
Hi All,
I have a couple of questions regarding Datasets, which I hope y'all might be able to help with.
1) In my (ASP.Net 2.0 / C#) web application I'm accessing a database - all well and good so far. Because I'm just starting out with C# and DB programming, I created a (one) DataSet to represent the whole database, and added methods to each TableAdapter to facilitate Selecting, Updating, Inserting etc, which I can access from my code - which is a seriously cool feature!
Am I going to lead myself into a lot of trouble doing this? Should I split the DataSet down to some logical smaller DataSets - or will this not affect performance?
2) Given that this is a web application and could potentially have lots of users (in reality I expect about 10 max) should I consider making the DataSet (which I think is my Data Access Layer?) a Singleton to prevent the WebServer having to run hundreds, even thousands of instances - if so, how do I do this, as I can't seem to find any C# code in the DataSet code, just loads of XML?
3)In one of my DataAdapter methods I'm Inserting a Row into a table. One of the fields is a foreign key of another table. In order to make the experience nicer for a user, a Listbox provides the friendly name of the Primary Key (ie "Green Pool Table" rather "102"). I thought it would be possible to include a SELECT statement into the VALUES clause of an INSERT statement to perform the lookup for me, but the following doesn't seem to work:
INSERT INTO [tblAssets]
([AssetSerial], [AssetTypeID], [AssetStatusID], [OwnerID])
VALUES (?, ?, ?,
(SELECT AssetTypeID
FROM tblAssetTypes
WHERE AssetType = @ Namen))
...the QueryBuilder chucks this out as invlaid. I'm using Access for my dev system, but is this wobbly SQL or would it work in a different RDBMS? (And if there's a better way of doing it, please shout!)
Thanks,
Martin.
|
|
|
|
|
Firstly let me say that I havn't done that much with ADO.NET but here are my suggestions. Secondly thank you for asking specific questions and itemising them to make it easier for people to help, there have been lots of people recently who don't do that and you've made me realise why I help people out
Utini wrote: Should I split the DataSet down to some logical smaller DataSets
I would suggest this as it reduces redundancy in the data, it all depends on what you are trying to achieve and how the DataSet is actually structured.
Utini wrote: will this not affect performance?
All changes affect performance but I shouldn't think that it'll be too noticable.
Utini wrote: should I consider making the DataSet (which I think is my Data Access Layer?) a Singleton
If you're only going to get 10 then I wouldn't bother unless the machine isn't that powerful and/or is running other services. Try both out and use your judgement.
Utini wrote: can't seem to find any C# code in the DataSet code, just loads of XML?
The DataSet is XML but if you use the "Show All" button in Solution Explorer then there should be a file named the same as the dataset but with a .cs extension. This will have been autogenerated by the IDE.
Utini wrote: 3)
Can't you use DataBinding to set up a bound listbox, rather then filling it yourself. I'm not a wizz on SQL and infact have never used INSERT statements so I'm sorry that I can't help you.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Thanks for the reply Ed.
I think my understanding of DataSets is a bit suspect - basically all I've done is drop each table in to the same Dataset file. I'm not sure if this good or bad, but the database itself is pretty well normalised, so I guess it shouldn't matter too much.
I'll also investigate the performance implications - I may even write an article on it
The DataBinding idea is definietly a good one - I hadn't realised that you could have a Data and View column in them - thanks!
|
|
|
|
|
Not a problem, I don't have much use for DataSets (or DataBinding for that matter) since I tend to write more utility like programs than database (just finished my A-Level project which had to involve a database (never again))
Famous last words...
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Well, if you ever get into paid development you'll be using databases and nothing but (unless you're lucky enough to do something cool like games programming!)
|
|
|
|
|
Almost all of the paid programming I've done doesn't involve databases. I've written several utilities for programming systems, e.g. one for programming a lighting controller, one for programming a medical electronics system. And a hell of a lot of embedded C stuff.
But then again I'm going to begin my Electronics Masters this October so this type of programming is more my scene and I have more connections in this field than in the "Computer" (i.e. pure software) field.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I've created a program that make a c# class.
Can i inlcude with my application a free program that produce a .dll file?
|
|
|
|
|
I believe the C# command line compiler (csc.exe) is part of the .net framework re-distributable.
Link[^]
Don't forget to check the license though...
- Dy
|
|
|
|
|
How can i to know how can i run it within my application then what the comand line are? where can i find the license?
|
|
|
|
|
Sasuko wrote: where can i find the license?
Download that link, there will be a text or HTML file included detailing the licence.
Sasuko wrote: how can i run it within my application then what the comand line are?
csc.exe yourCodeFile.cs
Look in MSDN for documentation on csc.exe, it will explain producing a DLL etc. if that's what you need
- Dy
|
|
|
|
|
This might be what you're looking for...
new Microsoft.CSharp.CSharpCodeProvider().CreateCompiler()
Josh
|
|
|
|
|
Ok, I have inhertied a some code in which I find that the previous developer has done something I do not agree with but..I have to work with what I have got.
There is a typed dataset called QueryDataSet and there is an object called
QueryDataObject that inherits from QueryDataSet. In the development enviorment all is well mbut when I get to my executable, I get the following error:
"The constructor to deseralize an object of type WTI.Fortis.QueryDataObject was not found".
I am thinking that the previous developer was changing the constructor
protected QueryDataSet(SerializationInfo info, StreamingContext context) {
that is genereated as a result of me autogenerating the dataset to public.
Any thoughts on this matter would be greatly appreciated.
Sameer
|
|
|
|
|
QueryDataObject must implement ISerializable as well as QueryDataSet (I think). You might be able to get around it by casting QueryDataObject to a QueryDataSet and Deserializing that instead.
I havn't used Serialization that much but I do remember coming across something along the previous lines.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Well the QueryDataset is a type dataset and that does not implement te ISeralizable interface by default and I am pretty positive that casting QueryDataObject to a QueryDataSet maynot by me much, but I am going to try to implement the Iseralizable interface on the QueryDataObject and see what happens.
|
|
|
|
|
Sorry I wasn't more help
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hello,
I am involved in a project for writing auto-update applications in .net using Background intelligent transfer service. can somebody please help me with usefull example codes in c#
gurrumurthi
|
|
|
|
|
Heard of Google?
If not follow the link and click the first result, et voila, a C# example from Microsoft none the less
Sorry if I'm a bit sarcastic but 10 seconds to load and type something in Google will save many people a lot of time somewhere down the line.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
thank you very much ED
i have seen it but the problem is i am a new graduate and i am also new to the field i find it quiet difficult to understand the logic behind it.
if u no please tell me.
gurru
|
|
|
|
|
Sorry I don't know anything at all about BITS (and don't have time at the moment to find out) apart from a general overview of what it does. My suggestion would be to try out the tutorial in the article and see what happens there. If you run into more problems then ask some more questions.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hi everyone
i want to learn developing applications for mobile devices.
can anyone help me how to start?
i prefer .net platform
someone plz come up with an answer.
thanks in advance for help.
anup
|
|
|
|
|
I think mobile software isn't developed with C# but rather modified C++ for Symbian systems. It does have some support to .net platform, but it's somewhat limited. If you want to develop more traditional Java applications, then you're in wrong area.
Links to different symbian stuff you'll be needing (Nokia mainly):
http://www.forum.nokia.com/main/0,,034-483,00.html (S60 SDK platform for Symbian OS, for Java)
http://www.forum.nokia.com/main/0,,034-902,00.html (Some tools for developing (I think this was 14 day test version)
http://www.forum.nokia.com/main/0,,034-4,00.html (S60 SDK platform for Symbian OS, for C++)
Please note that these require Visual Studio and it doesn't work in Visual Studio Express.
I think there's free Borland version somewhere too.
if you're brave, try: http://simonwoodside.com/dev/symbian/howto.html
In future, please post to the correct forum, thank you.
-- modified at 8:18 Wednesday 24th May, 2006
|
|
|
|