|
Great N a v a n e e t h!
Question answered.
regards,
George
|
|
|
|
|
This issue is with respect to Windows Application
I have 2 comboBox in the same row of a DatagridView. When I attach an event one of them, the other comboBox also fires the same event. How can I attach an event only to a particular combo in a DataGridView
|
|
|
|
|
Make use of the sender argument. Check sender is the required combobox. If yes, continue processing.
|
|
|
|
|
what's the diffrence between these two declarations:
ObjectType objectName;
ObjectType objectName=null;
|
|
|
|
|
The first statement means that you are going to declare an object and the second statement mean you are going to dispose an object. If you want to dispose an object then you assign null to that object.
|
|
|
|
|
arslanjatt wrote: The first statement means that you are going to declare an object and the second statement mean you are going to dispose an object. If you want to dispose an object then you assign null to that object.
This not correct. Both means same. Also you don't need to assign NULL to an object which you want to dispose. It is handled automatically and an object will be garbage collected when nothing is referring it.
|
|
|
|
|
Hi Navaneeth,
Do developers consider it good practise to always initialise an instance to null when they are declared?
For example, if I always declared variables, and set them to null as below:
<br />
Class class1 = null;<br />
would it be bad practice and/or any slower than:
<br />
Class class1;<br />
|
|
|
|
|
Hello Mark,
MarkBrock wrote: Do developers consider it good practise to always initialise an instance to null when they are declared?
I am not sure, but I never used to assign NULL when it is declaring.
object obj;
object obj1 = null;
Console.WriteLine(obj == null);
Console.WriteLine(obj1 == null); This won't compile. Compiler will give error saying obj is not assigned. So easily I can find out uninitialized variables. But if you assign NULL to it and forget to initialize, compiler won't give any error, but you will end with a NullReferenceException at the runtime. I think performance wise there won't be any difference.
|
|
|
|
|
It's not good practice to initialize a variable to null in .NET because it's already done automatically by the CLR. It just wastes an instruction because it's redundant and unnecessary. See Effective C# by Bill Wagner.
|
|
|
|
|
so they're the same in memory but not in cpu usage you mean?
|
|
|
|
|
|
|
Alan!I wanted to mark ur anwer as reply or sth like that,and I clicked
report this message link
is there any way to undo it?
|
|
|
|
|
Ah, so THAT'S why the Code Project agents showed up at my place with a warrent!
|
|
|
|
|
They both are same. If you are using first one, compiler will give error. But for second one, you will get error only in the runtime.
modified on Tuesday, June 17, 2008 3:18 AM
|
|
|
|
|
Hi,
I have to build a windows application in C#. What the application needs to do is print doc files even Microsoft word is not installed. Do you guys have any solution. Please help me out. Thanks in advance.
regard,
Arslan Ilyas
|
|
|
|
|
.doc is a proprietry format, you need MS word to access it. You may be able to do it with the free "word viewer" but I don't know.
In theory it's possible to reverse engenieer the .doc format and write your own parser to read and print it, but that won't be easy. OpenOffice have obviously done something like that as they can handle word files, so you could start by looking at their source code.
There may be 3rd party libraries out that that provide this kind of functionality (search google), but it's not built into .net as standard.
Simon
|
|
|
|
|
Hi
is there any way to add references to my project by code (at runTime)?
thanks.
|
|
|
|
|
|
|
thanks N a v a n e e t h
but i don't compile my app, i want to add reference to my app at runTime, and i don't want to compile any code.
|
|
|
|
|
hi to all
i write some simple webservice in below and put into http://bundi.com/webser.asmx
i take a web refence and created object and it is working fine, plase follow the code and finally please answer my questions
webser.asmx file conetent in which i have in http://bundi.com/webser.asmx
***************
]]>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Namespace mysimpleWebService
<webservice(namespace:> _
<webservicebinding(conformsto:> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Public Class webser
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function sum(ByVal a As Double, ByVal b As Double) As Double
Return a + b
End Function
End Class
End Namespace
default.aspx page content
*************
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim objweb As New summethod.webser
objweb.sum(19.1, 30.9)
Response.Write("sum result is " & objweb.sum(19.1, 30.9))
End Sub
End Class
here my problem are
**********************
1) this webservice accessign directly how i protect this with password the perticular webservice
2) is anything more need to learn about webservice,what other uses , can u explain any thing more to learn web service
This is haneef.............................................................
|
|
|
|
|
Hi all--
I've written a program to transmit data to a RS-232 device and everything was working fine. Now, due to design constraints, the device uses inverted RS-232 logic. I've tried to compensate for this by inverting my bytes before transmission but that doesn't work. Somebody here thinks that my stop and start bits also have to be inverted and thats why the microcontroller isn't picking anything up.
I'm over my head on this one, anybody have a clue if I'm looking the right direction or is what I'm saying sound stupid?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I need some help again...
I need to create a Struct to pass to an Array, trouble is I have NEVER worked with structs. I am not even sure that this can be done. I have read about structs and my understanding about them are that a class uses the managed heap and a struct uses the stack, this makes for a LITTLE performance gain.
I also understand that you can create your own Value Types for example:
My Variable
{
private string myString;
private int myInt;
}
Theoretically this gives me a variable "Variable" that's of type string and int?? Am I in the right direction??
Thanks in advance!!
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: a class uses the managed heap and a struct uses the stack, this makes for a LITTLE performance gain.
It's not true always. It depends on the context where you declare the value type variable. Read this[^]
Illegal Operation wrote: I also understand that you can create your own Value Types for example:
You can create your own structs which are value types.
struct MySampleStruct
{
public int a;
}
|
|
|
|