|
Thank you so much for your help
but thing is where should i declare IncrementObject function and i want to pass value which i have to increment. Let me clear my self
suppose i have different type for numbers(i.e. sequential, numeric) ok? so in sequential increment will be done 1,2,3 like that. in numeric increment will be done like 1.0,1.1,1.1.1, or 2.0,2.1,2.1.1 OK???
SO for that i have one interface INumber
public interface Inumber
function increment(-----)as -----
end interface
public class sequential implements Inumber
public function increment(----) as ----
'so here increment by one will happen
end function
end class
public class numeric implements Inumber
public function increment(----) as ----
'so here increment by 0.1 or 0.0.1 will happen
end function
end class
hope you get me now when i am calling this function i am checking for its type. If it is sequential then i will call sequential's increment and if it is numeric then i will call numeric's increment function
Please tell me what should i pass in that function and return from that function
Thank you so much
|
|
|
|
|
hi there,
more appropriate solution is as follows
Private Sub IncrementObject(INumber incrementor)
incrementor.Increment()
End Sub
Public Shared Sub Main()
Dim s As New Sequential()
Dim n As New Numeric()
''
'' This will execute Increment logic of Sequential Class
IncrementObject(s);
''
'' This will execute Increment logic of Numeric Class
IncrementObject(n);
End Sub
Above method accepts object of type INumber, so any number of classes in which you implement INumber interface can be passed as argument in this method and this method will execute appropriate logic of increment,
Instance of Sequential Type will execute its own increment method.
Confidence comes not from always being right, but from not fearing to be wrong.
Mihir..
|
|
|
|
|
Thanks buddy i hope this will work
|
|
|
|
|
Acc. to your interface declaration. I'm not clear why you need a parameter of type "myInterface" in function.
However, if you still want to use
create an object of myInterface and pass them as parameter in function
Regards,
Akhilesh Yadav
|
|
|
|
|
what are one tier,two tier and multi tier applications. what is difference bet. them
sukhchain singh
|
|
|
|
|
sukhchain singh wrote: one tier
Everything needed to run the application is in one place. Desktop applications are often single tier.
sukhchain singh wrote: two tier
Also known as client-server
sukhchain singh wrote: multi tier
There are chains of clients and servers. e.g.
Database server --> Web Server --> Client Browser
In the above example the Web Server acts as a client of the database server as well as the server of web pages.
"tier" is also sometimes used interchangeably with "layer" when referring to how an application is constructed internally, rather the infrastucture supporting the application.
A single layer application uses the "Giant Ball of Mud Pattern" and should be avoided for all but the smallest of applications.
Application layers typically refer to presentation layer, business layer and database layer.
|
|
|
|
|
Hi,
First, I havee a table and I have to create xml programmatically using C#. And secondly,
Please let me know, How can I create xml file of other tables, if the tablename is passed as a parameter in the method using loops.
For example:
public void Parse( string Product)
{
XmlNode xmlnode = null;
XmlDocument doc = new XmlDocument();
???????????
}
How do I do that?
Thank you
Sanjeev
|
|
|
|
|
|
Private Function CreateXmlFileUser(ByVal objDs As DataSet) As String
' Create a file name to write to.
Dim filename As String = "myXmlUsers.xml"
' Create the FileStream to write with.
Dim myFileStream As New System.IO.FileStream(filename, System.IO.FileMode.Create)
' Create an XmlTextWriter with the fileStream.
Dim myXmlWriter As New System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode)
' Write to the file with the WriteXml method.
objDs.WriteXml(myXmlWriter, XmlWriteMode.WriteSchema)
myXmlWriter.Close()
Return filename
End Function
i this is very useful for you...!
Enjoy
Pavan Pareta
|
|
|
|
|
I'm finding it surprisingly hard to determine if session state has been deactivated on a page through code behind. Just referring to Page.Session throws an exception if it's turned off on that page (i.e. if(Page.Session!=null) throws an exception ) which as we all know is a very bad thing indeed.
Is there a reliable non exception generating way to check if a page has session disabled?
|
|
|
|
|
Found it:
If you check Context.Session for null it won't throw an exception and is reliable indicator of session enablement status.
|
|
|
|
|
I have a gridview that I'm correctly binding correctly, but I can't seem to get the formatting of a datetime column correct and was hoping I could get some advice on what I'm doing wrong.
The column, I have defined as
<asp:BoundField DataField="ClosedDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date Added" />
I originally had DataFormatString="MM/dd/yyyy", but that literally displayed just that, so the {} part helped. Now, however, it displays the time in addition to the date, which is something I don't want. Is there some trick with the number before, or the specific formatting that I'm using that is making it display the full datetime?
|
|
|
|
|
Hi there,
You simply set the BoundField.HtmlEncode Property [^] to false as this property has the true value by default and this causes the formatting not to work.
|
|
|
|
|
Worked perfectly, thanks.
|
|
|
|
|
Haii,
I need a help regarding making the servercontrols masked based on the input given selected before.
for example, if i select a value from radio button for choice then based on that choice some webcontrols should be masked (eg text boxes concerned on that choice)on the form during selection(runtime).
Please help me out with this..
Thank you for the reply to my previous question.
veerendra
|
|
|
|
|
|
I have a userControl, at run time i fill a table with 5 user controls,
when i creating instances as artical about creating user control instances[^]
I added handler of user control event to a function, but when i raise event ( for example clicking a button in User Control) , there is nothing, the function is not executed.
2. question is that i fulfill panel with UC s but when i click any button on Form (not exactly button on UC) to post the page , after posting back, i see panel has no UC .
|
|
|
|
|
Check event bubbling:
http://aspnet.4guysfromrolla.com/articles/051105-1.aspx
|
|
|
|
|
Hi all,
I put N control in a page, then I want get these controls in c# code,
so I wrote:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
foreach (Control ctrl in this.Controls)<br />
{<br />
Response.Write(ctrl.ToString() + "<br>");<br />
}<br />
}
But this doesn't write all controls on the page. so how to do it?
Thanks.
|
|
|
|
|
You should also check for child controls of each control.
|
|
|
|
|
oh, yes, I got all controls in the page. Thanks very very much.
|
|
|
|
|
You're welcome.
It's refreshing to have someone write back saying "thank you". It doesn't hapen often.
|
|
|
|
|
|
Can i raise any event using Required field validator without posting it back to the server
Thanx in Advance
|
|
|
|
|
Client side Validators are simply javascript. You can raise your even there.
|
|
|
|