|
Hi,
I did as it is. But I want when press tab in T1
(textbox1) it check database whether the given data
in T1 is exist or not? if exist it give message like
already exist and it again wait for data there (T1)
only. once we are giving data which is not in the
database, then it moves to next field.
according to your logic it checks database. not
only that if we press tab it gives msg. and it
comes to next field. again we come back to T1 and
press tab with out changes, this time it won't give
any msg also.
Please help me.
with Thanks
laxmi
|
|
|
|
|
Good Day Sir/Maam:
I have a very simple question thats been bugging me ever since.
Clicking on the maximize button, the FORM (Window) will maximize, but the objects on will not.
Say I have a text box and a command button. If I hit maximize, the form will maximize but the text box and command button will just stay as is.
Is there anyway that they will maximize proportionaly?
Regards,
Ian
|
|
|
|
|
Hello,
You have to use the Anchor property of the controls.
All the best,
Martin
|
|
|
|
|
hi,
this is due the the anchor property of the controls.
by default they are anchored to the top left of the form or the containing control. if you want to maintain the same size then you can set the anchor all the anchor properties of that control. or you can even use dock property.
just play around with these two properties and you will know what works best for you.
if you want, you can even create an event handler to handle the layout event which is fired when ever the layout of the control is changed.
hope this helps.
regards
|
|
|
|
|
Hello experts,
I'm using Serialization to store a collection, and retreive it from a file.
However, there are times in my application that a single item inside a collection should be written/read.
I'm currently marking my collection class, and all the items classes it stores with the Serializable attribute.
I'm using a BinaryFormatter and a FileStream to serialize it.
How can I update the file without writing the entire collection again and again?
Thanks in advance,
Shy.
|
|
|
|
|
I have to do a modification in our software,
see our software sends messages,
So, i want to modify like this, Suppose there is folder in which whenever a text file is being dumped then
software regularly checks that folder and when a file arrives it send to a particular address.
the file name is the destination address,
is there any way to do this?
plz help me. any similar code like this in any website then give me address, i want in c#, but if any other lang, then also no matter.
|
|
|
|
|
Have a look at FileSystemWatcher class
|
|
|
|
|
i saw ur articals but there is no article like filesystemwatcher?
|
|
|
|
|
He doesn't meant to search in his articles.
The link is allways in his Signature.
Very confusing off corse.
Try searching on the CP articles[^]
Or msdn doc[^]
All the best,
Martin
|
|
|
|
|
Hi all, I make a code to drag a text from a list to textbox but i want to insert it in a certin postion in the textbox how can i get the cursor position
merwa
|
|
|
|
|
Hello,
I think the SelectionStart property is what you are looking for.
All the best,
Martin
|
|
|
|
|
Hello merwa,
Martin is right, the mouse position has nothing to do with what you're trying to do, however if you're sure you want to get the mouse position, use e.Location for e is an automatically created mouse event argument for your control "textbox int this case"
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi, is there a way to use an enum as condition in an if statement. Say for example can I change the following code and use enum instead /thx:
string houseType = string.Empty; //is set to different housetypes
...
...
if(housType.Equals("detached house"))
..do something
else if(houseType.Equals("manor"))
..do something else
|
|
|
|
|
Sure:
enum HouseType {UNKNOWN, DETACHED, ... }
HouseType myHouse=HouseType.UNKNOWN;
...
if (myHouse==HouseType.DETACHED) ...
...
Now if you want enum values that are not valid identifiers, you need some special
trick, e.g. add Attributes to each enum value, and retrieve them using reflection.
|
|
|
|
|
Many thx Luc
|
|
|
|
|
Or use static class, like
class HouseType
{
HouseType(string){...}
string desc;
public string Description { get {return desc;}}
}
static class HouseTypes
{
static HouseTypes()
{
type1 = new HouseType("House of type1");
}
public HouseType Type1 { get {return type1}}
}
...
if(myHouse.HouseType == HouseTypes.Type1)...
It should have better performance then using attributes but it consumes some extra memory.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Hi all,
Can any one suggest/guide me how to record and store the video captured by the system web camera. I want to record the video which captured by my web camera and want to store it in my local hard disk. I want to do this using c# as an desktop application.
I got some ssamples to capture the video only, but i need ideas how to store the videos.
Plz any one suggest me how to do it.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
For specific web cams you will have to look to see if their is an API command library that you can use. Or you can do a search on this site for: web cam. You will get many results, one being http://www.codeproject.com/cs/media/motion_detection_wc.asp[^]. Their is another example of a webcam article that I like better, but the search didn't come up with it.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thanks for your reply. I will have an look on your suggestions. Thank you once again
Know is Drop, Unknown is Ocean
|
|
|
|
|
I'm trying to simulating a button containing in a form.By reading some reference articles,I'd seen that most of them suggested to use webbrowser control,and then acquire htmldocument2 dispatch to get IHTMLInputButtonElement interface.But I'm now doing real time system,it demanded to get infos as soon as possibly,so I must use multiple threads to solve it.From some articles,I heard that webbrowser control cannot be used in multiple threads environment.So what's the better way?
|
|
|
|
|
Hi friends..plz go through this pseudo code
I Included Requirid Namespaces
Dataset ds;--------------------------------------1
//static Dataset ds;-----------------------------2
protected void page_load(parameters)
{
ds = function in Data acesss Layer which retrives records from database and returns dataset.
populatedatagrid();
}
void populatedatagrid()
{
if(mydropdownlist.selectedIndex=0)
datagrid1.datasource=ds;
else
{
datagrid1.Datasource= here I performed filtering action using Row Filter Property and selected Index Value
}
}
void mydropdownlist_selectedIndexchanged(parameters)
{
populatedatagrid();
}
I am designing a web page where by default all records will displayed.but by selecting from dropdownlist I can filter the records.Later I thought its not right to perform the fuctionalities of the page_load event at each postback(unnecessry making connection to the database)..so i used Page.Ispostback to avoid that..so first time it worked fine but when i selected from dropdwn list it throws an error "object reference not set to an instance of object"..
reason for above error i understood(because in page load event i am returning dataset which does not happened at page post back)..so one of my friend commented the line no-1 and uncommented the line no-2 in above code..thus made dataset static..and it works
What I am not understanding is why making the dataset static solved the task..though HTTP is static?Is making dataset ststic makes the records to be saved at server?
Warm Regards,
Rahul Agarwal
-- modified at 7:28 Tuesday 12th June, 2007
|
|
|
|
|
First off, this is an ASP.Net question, not one specific to C#. You should post it to the ASP.Net forum for more timely response.
Now, unless you personally make some attempt to persist your data source (or reconnect and query it each time) across page turns, it will not persist itself. At the very least, you need to bind your data source to its control after each page turn (Postback or not), and at most - meaning if you don't want to reload your data after each page turn - you need to persist it statefully. The static variable is a bit much for this application, but it proves the point.
Is ViewState enabled for your dropdownlist? If you're doing filtering after your initial binding it won't really matter since you'll need access to your datasource, not the expression of the data in the control, but it's something to check.
Other ways to do the same thing would be to push the data source to ViewState manually, or use the Session or Application objects - it all depends upon your needs.
I would recommend looking up the ASP.Net page life cycle to better understand what happens each time a page is turned (whether it's a new HTTP Request or a Postback).
Good luck
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Why doses C# not support Multiple Inheritances?
Is there any disadvantage?
Vikas Neema
|
|
|
|
|
hi...
check this:
#
What is multiple inheritance? What are its advantages and disadvantages?
Multiple Inheritance is the process whereby a sub-class can be derived from more than one super class. The advantage of multiple inheritance is that it allows a class to inherit the functionality of more than one base class thus allowing for modeling of complex relationships. The disadvantage of multiple inheritance is that it can lead to a lot of confusion when two base classes implement a method with the same name.
source link : http://www.possibility.com/epowiki/Wiki.jsp?page=CppInterviewQuestions
you can implement multiple interface instead of multiple inheritance
hope i helped
Tarek Elganainy
Computer and Systems Engineering Dept.,
Faculty of Engineering,
Alexandria University.
|
|
|
|
|
See the last post here:
Why no multiple inheritance allowed in C#? [^]
It reads:
This is an answer on this question, as posted on a C# FAQ by Chris Brumme:
1. Different languages actually have different expectations for how MI works. For example, how conflicts are resolved and whether duplicate bases are merged or redundant. Before we can implement MI in the CLR, we have to do a survey of all the languages, figure out the common concepts, and decide how to express them in a language-neutral manner. We would also have to decide whether MI belongs in the CLS and what this would mean for languages that don't want this concept (presumably VB.NET, for example). Of course, that's the business we are in as a common language runtime, but we haven't got around to doing it for MI yet.
2. The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?
3. Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.[/]
As far as I'm aware, the only language that supports full MI on .NET is Eiffel.
Full Eiffel on the .NET Framework[^]
Kevin
|
|
|
|