|
hi Illegal Operation
Why do you return an Object? You asked me an Unclear Question in my Article. Let me explain Briefly.
Illegal Operation :Wrote
My DataAccessLayer Method looks something like this:
public object GetData(DataSet dsMyDataSet)
{
return dsMyDataSet;
}
In your Getdata Function, you are Doing strange things, you return an Object and you asked us how to pass a dataset across DAL and BLL, First you have to change that object to a Dataset, and another thing in your Parameters, logically i dont know what you are trying to do. Your are accepting a Dataset as a Parameter and at the same time your want to return a dataset. When you getdata,it must be either void or search using something like string ,int etc not dataset. If you want to Pass the Dataset in this case you can change you function to look like this
public Dataset GetData()
{
return dsMyDataSet;
} ;
and lets come to your BLL
Illegal Operation :Wrote
My BusinessLogicLayer looks something like this:
public object GetData1()
{
datalayer = new datalayer();
datalayer.method();
}
Here again you return an Object, with what control are you going to bind the Object? Your Code
datalayer = new datalayer();
will not Compile, you did not create an Object of a Class. Your BLL Should look like this
;
public Dataset GetData1()
{
datalayer obj = new datalayer();
Dataset ds = new Dataset();
ds = obj.GetData();
return ds;
} ;
After you have this , you can bind it to any Control that you like.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hey,
I have downloaded your source and saw that you instanciated a dataset in the PL before the method.
Anyway, your code has helped me solve my problem and for that I thank you!! I see that you are from South Africa?
I am also from South africa but I currently work as a software developer in Australia. For what company do you work? I worked for Business Connexion.
Thank you again for the article - it made a LOT of things clear...
Illegal Operation
|
|
|
|
|
Am From the Capital City "City of Tshwane" Previously Pretoria. Am working for the Municipality of Tshwane. Am Glad the Article Helped you, Did you Vote for it ? How is Australia ? I would like to have an Employer from outsite South Africa, but still South Africa is treating me well
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello.
I am SourceGrid beginner.
The version uses 4.11.
The following tables were made.
|aaaaaaaaaaa|
|bbb|ccc|ddd|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
The first lines unite with columnspan.
Can able to be made it to scroll and how do by me without at that time though the line between ccc and ddd can be scrolled during bbb and ccc of the second line?
Moreover, RowHeader can be scrolled between line - numbers. Is there a method of not allowing this to be scrolled?
My best regards.
|
|
|
|
|
Hello everyone,
According to MSDN, we should "make exceptions serializable". I think it means we should implement the constructor which accepts SerializationInfo and StreamingContext as input parameter, correct?
If yes, could anyone show me how to implement it please?
http://msdn.microsoft.com/en-us/library/ms229064(VS.80).aspx
public class MyException : Exception
{
private int _errorCode;
private string _errorDescription;
public MyException (int errorCode, string errorMessage)
: base (errorMessage)
{
_errorCode = errorCode;
_errorDescription = errorMessage;
}
protected MyException (SerializationInfo info, StreamingContext context)
{
}
}
thanks in advance,
George
|
|
|
|
|
[Serializable]
public class MyException : Exception
{
private int _errorCode;
private string _errorDescription;
public MyException (int errorCode, string errorMessage)
: base (errorMessage)
{
_errorCode = errorCode;
_errorDescription = errorMessage;
}
protected Public MyException (SerializationInfo info, StreamingContext context)
: base(info,context)
{
this._errorCode = info.GetString("ErroCode");
}
} BTW, I have seen the same in MSDN forums too
|
|
|
|
|
Thanks Navaneeth,
Why you remove my string class member?
regards,
George
|
|
|
|
|
Base class Exception provides a member Message which can be used.
|
|
|
|
|
Thanks Navaneeth!
This constructor is called when an instance of type MyException is deserialized from a stream? So, the constructor is used in de-serialization process, not serialization process?
MyException (SerializationInfo info, StreamingContext context)
regards,
George
|
|
|
|
|
George_George wrote: This constructor is called when an instance of type MyException is deserialized from a stream?
I don't think so. Deserialization has to take place outside of the exception class and pass that SerializationInfo to this overload which will fill the necessary fields of this exception.
|
|
|
|
|
Thanks Navaneeth,
I am confused about -- "Deserialization has to take place outside of the exception class and pass that SerializationInfo to this overload which will fill the necessary fields of this exception." Especially confused about what means "take place outside of the exception class"? Could you show me some simple pseudo code please?
have a good weekend,
George
|
|
|
|
|
Im trying to send some GET and POST request to a website with the HttpWebRequest control.
The problem is that the server is giving me blank reponses when i try to do a post, and this is because the cookie i send doesnt have utma, utmz and utmc values, but i have no idea how to setup this variables, i tought they were gonna be set automatic like in the browser cause as far i know is for session tracking, but no
heres an example of the cookie values i dont know how to get/generate, sniffed from mozilla 3.0.3
__utma=56969722.1488837505.1226268589.1226445794.1226522343.8;__utmz=56969722.1226268589.1.1.utmccn= (direct)|utmcsr=(direct)|utmcmd=(none);__utmc=56969722;");
and heres my c# code
Code:
try
{
req = (HttpWebRequest)WebRequest.Create("http://www.domain.com/");
myWebHeaderCollection = req.Headers;
myWebHeaderCollection.Set("Accept-Language", "en-us;q=0.5,en;q=0.3");
myWebHeaderCollection.Set("Accept-Encoding", "gzip,deflate");
myWebHeaderCollection.Set("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
req.KeepAlive = true;
req.ServicePoint.Expect100Continue = false;
req.Referer = "";
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)";
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
req.Method = "GET";
req.CookieContainer = cookieContainer;
response = (HttpWebResponse)req.GetResponse();
sr = new StreamReader(response.GetResponseStream());
getOutput = sr.ReadToEnd();
sr.Close();
foreach (Cookie cook in response.Cookies)
{
cookieContainer.Add(cook);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
Any ideas how i could get this cookie?
|
|
|
|
|
what defferences between:
public void function1() and
public object function1()
Thanks
|
|
|
|
|
hunghero wrote: what defferences between:
public void function1() and
public object function1()
The first one doesn't return anything, the second one returns an object reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
when should we use a function or an object?
Thanks
|
|
|
|
|
first you must understand some types of method
1. a method that doesn't have any returns and parameters, in C# i.e : void methodname()
2. a method that pass parameters by value, this method doesn't change the parameters value after execute i.e : void methodname(object par1[, ...object parN])
3. a method that pass parameters by reference. This method will change the parameters value after execute i.e : void methodname(ref object par1[, ...ref object parN])
4. a method that return a value with or without parameters (either pass by value or by reference) object methodename([object par[, ref object var]]
in some programming language these method are divided into two that is procedure and function. A Procedure (Sub in VB) is a method that doesn't have a return value. A Function is a method that returned a value.
hunghero wrote: when should we use a function or an object?
when you needed
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Seriously, pickup a beginners book on C# and work through it. You're asking questions that would be covered in the first couple of chapters.
|
|
|
|
|
Dave Kreskowiak wrote: Seriously, pickup a beginners book on C# and work through it.
Ditto that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have two very simple report in my winform project.
Development machine is windows vista home premium, vs 2005 sp1 and crystal report sp1 for vs 2005.
I read the printer name from a config file and use that printer name in code
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
PaletteLabelPrinter is a string holding the printer name from config file.
When I deploy my app to server 2003 R2, I simple have an error for report printing if I have a different printer name at the server than at my development machine.
Crash (exeption) happening right at the line like below
crReportDocument.PrintOptions.PrinterName = PaletteLabelPrinter;
Error is as follows
Error in File C:\DOCUME~1\alc.......... The request could not be submitted for background processing
Besides, even though I installed the crystal report sp1, vs2005 just stop running when I select from
menu as following
Crystal Report -> Design -> Printer Setup, do something change and press OK then VS2005 simple
stop working.
Please help
Thanks to everybody
Muharrem
|
|
|
|
|
Don't double post.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi everyone,
I have been researching this topic for a few hours now and have not found any good sources of information. Basically, I have a windows service and a windows form application. The winform app can control the service (start, stop, pause...). However, the service runs long processes, and I would like for it to report progress that can be displayed by the winform, when the winform is running. The progress should be reported by raising events that the winform will subscribe to.
I know I will have to have a shared library that contains an interface or class that the server extends or inherits. I am not sure how to the whole thing would be structured though.
If anyone has any experience with this and can share a very simple example, I would really appreciate it. Links to related articles are also very welcome.
Thanks in advance,
-----------------
Picazo
|
|
|
|
|
Have you looked into .NET Remoting?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes. I would like to use the IPC channel since the service and the winform will live on the same machine. I have used IPC before, but never with winservices or events. That is the part that I would like some advice or assistance with.
Thanks,
-----------------
Picazo
|
|
|
|
|
|
I have an update which is further aggravating. If you open Outlook Express. Create a new message, then save the message, close the message and execute the message, you will see there is no "Send" button. We originally thought the issue was a problem with headers and might still be.
|
|
|
|