|
Hum Dum wrote: How to do this?
Manually.
See TextBox.OnChange event, but be aware that this is "odd" behaviour - not what users expect from a text box. Is there no better solution you can apply, such as moving the text to a label so the TextBox is empty?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: moving the text to a label so the TextBox is empty?
This is one solution?
But moving whole text to a label then adding new text?
application like daily/weekly update on a task.
so text is goes on increasing?
also there are 3-4 fields where user has to add its progress,
and moving each on a seprate labe, makes things somewhat unpleasent?
can't there be any better way.....?
just user can't modify previous data?
any help appreciated....
|
|
|
|
|
Hum Dum wrote: But moving whole text to a label then adding new text?
application like daily/weekly update on a task.
so text is goes on increasing?
also there are 3-4 fields where user has to add its progress,
and moving each on a seprate labe, makes things somewhat unpleasent?
can't there be any better way.....?
just user can't modify previous data?
any help appreciated....
Ok, so what it is is an update of a to-do-list or similar, with the user inputing new progress?
In which case, yes it will keep increasing - what you need to do is treat each new progress update as a new record and display it in - for example - a grid control. Or better a DataGrid if you store the updates in a database, which would make sense.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Try this in TextBox Keypress event
if(textbox1.text.lenght > 0)
{
if(e.KeyChar == "backspace","Delete","shift","Home","End"
{
e.Handled = true;
}
}
|
|
|
|
|
I think that is not sufficient, the user could still use the mouse to select some text, then type new text replacing the selection.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
|
how about each 'update' is a new entry in the database. then you use a control such as a datagridview (or make a custom one) that displays each entry along with the time and date that it was made. Much better solution
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I would avoid having both old data that should not be changed, and new data, that the user wants to add and edit, in a single control.
Maybe have a read-only TextBox showing what is already processed, and a smaller TextBox allowing the entry (with editing) of new data plus a "Enter" button (or act on ENTER key).
And as always, I don't like Textboxes for large amounts of data, so I would prefer a ListBox or DataGridView for old data, and a Textbox (or whatever suits best) for new data.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hello,
How can i access public variables in a WebService..using the object that i create in the WinApp?
Is posible to call method at a WebService by sending its paramters by refrence..?
Thanks
|
|
|
|
|
Well I would say no. Sending by reference will not work, because both 'apps' (winapp and webservice) reside in different memory spaces. The pointer (reference) to a position in memory will be uselesse to the other part...
|
|
|
|
|
Hi,
You can't access fields in a web service. It would be possible to change the state of the service by calling a web method and then have the service change it's own state in response to it, but in general web services should be stateless so it's basically a bad idea.
It is not possible to send parameters by reference to a web service.
You might want to look into remoting as it seems the things you want to do are the sort of things a web service isn't right for. Web services have one primary advantage over other services: They are more interoperable - it is possible to build clients for the service using many different tools and this in turn means it can be used by a Symbian cellphone or an iPhone or a Windows/Linux/other-based computer.
It is also possible, with WCF, to build a service class and expose it through remoting AND as a web service (as well as other endpoint types). You may want to learn a bit more about the technologies before you go ahead and design the solution to whatever problem you're trying to solve.
|
|
|
|
|
public class WebServ : WebService
{
public VirtualDiskHandler WS_m_pHandler;
}
private VirtualDiskHandler m_pHandler;
WebServ WebS = new WebServ();
m_pHandler = WebS.WS_m_pHandler;
How can i do that..?
|
|
|
|
|
I understood the question. But (a) you should not make a web service stateful, (b) you cannot read the fields of a web service even if you do give it fields.
So, if you absolutely insist on making your service stateful, you have to add a webmethod that a client could call to get the value of the field, like this:
[WebMethod]
public VirtualDiskHandler GetDiskHandler()
{
return WS_m_pHandler;
}
As said, this is a bad idea. And even if you *still* insist on doing it, it would only work if VirtualDiskHandler is a type the FrameWork is able to put as xml on the wire in a meaningful way. You can't call methods on it as if the object was running on the client.
If you do not understand this explanation you simply need to study what a web service is before you try to design your own. I'm not saying this to be mean, but because I suspect you need to be told so.
|
|
|
|
|
dojohansen wrote: It is not possible to send parameters by reference to a web service.
Are you sure?
|
|
|
|
|
Jeeze. A reference is ultimately a memory address (though managed by the runtime). How could it possibly even have any meaning to "pass by reference" when what you are actually sending to the server is a bloody SOAP message with XML?
|
|
|
|
|
dojohansen wrote: How could it possibly even have any meaning to "pass by reference" when what you are actually sending to the server is a bloody SOAP message with XML
Because SOAP defines the necessary communication protocol to allow it to do so, so although not "by reference" using the strict definition you used, to the programmer it very much is (you even use the ref keyword in C# to define such a web method).
|
|
|
|
|
I think we need to clarify our terms here. What does it mean to pass by reference? To pass the address of the thing we're passing (which may itself be a value or a reference) rather than the value.
Since web services and clients can run on completely disparate systems there is no type affinity and no common memory management between them. It is therefore meaningless to pass by reference in the sense described above.
However, if you are using .net to implement both the web service and the client, then the tool generates a proxy object that you use on the client to invoke the operations of the service. Since the proxy runs in the client appdomain there are no issues whatsoever with passing stuff to the proxy by reference. But the proxy method still passes the parameter as a SOAP-formatted XML message to the server, receives a respose as it does for any other request, and proceeds to update the external variable using the reference that was passed to it.
In other words, the reference never leaves the client at all and it is at best misleading to say that anything is "passed to the service as a reference".
|
|
|
|
|
Hi experts,
I am having a column name as Firstname/LastName, i am trying to filter this column using DataView.
DataView dv = new DataView(dtTemptable, "" + dtTemptable.Columns[1] + " in ('" + name + "')", null, DataViewRowState.CurrentRows);
I am getting an error:
Cannot find column [Firstname]. //i even used the column name diretly.
|
|
|
|
|
padmanabhan N wrote: i even used the column name diretly.
In that case, I think there must be some difference in the way you have represented 'Firstname' in your code and the database.
If you can get to the column in the Database Designer try copying and pasting it. It could be a casing error (FirstName, for example) or I have occasionally seen this fail because of a space inserted before or after the column name, even though it is supposed not to be possible.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I fully agree with Henry Minute.
I am providing you three scenarios.
Say I have a datatable like this
public DataTable MtDataTable()
{
DataTable dt = new DataTable();
dt.Columns.Add("First Name");
dt.Columns.Add("Last Name");
dt.Rows.Add("Niladri", "Biswas");
dt.Rows.Add("Deepak", "Goyal");
dt.Rows.Add("Padmanabhan", "N");
dt.Rows.Add("Code", "Project");
dt.Rows.Add("Niladri", "Biswas");
return dt;
}
In the Form's Load event, I wrote the following code
Scenario 1:
private void Form1_Load(object sender, EventArgs e)
{
DataTable dtTemptable = MtDataTable();
DataView dv = new DataView(dtTemptable, "[FirstName]", null, DataViewRowState.CurrentRows);
}
I got the error message "Cannot find column [FirstName]"
Scenario 2:
private void Form1_Load(object sender, EventArgs e)
{
DataTable dtTemptable = MtDataTable();
DataView dv = new DataView(dtTemptable, "[First Name]", null, DataViewRowState.CurrentRows);
}
I got the error message "Filter expression '[First Name]' does not evaluate to a Boolean term." But notice I thing, I did not receive the Column not find message. This time error occurs because it expects a boolean expression which I did not provided
Scenario 3:
private void Form1_Load(object sender, EventArgs e)
{
DataTable dtTemptable = MtDataTable();
DataView dataView = new DataView(dtTemptable);
dataView.RowFilter = "[First Name] IN ('Niladri')";
foreach (DataRowView drv in dataView)
MessageBox.Show(drv["First Name"].ToString());
}
This gives me the output as "Niladri" 2 times.
Hope this helps.
Niladri Biswas
|
|
|
|
|
Hi. I want to know on how to remove the cli header. I actualy dont know what this is... but i tried to dissasemble a random app. (.exe) with .NET Reflector and it said that it cannot be disass. because it does not contain a CLI Header.
If i try to dissasemble my .NET applications (just to create a new project and build it and then try to disassemble it) - it disassembles. Anyway on how to prevent on making this possible?
Thank you in advance!
Regards,
Matjaž
|
|
|
|
|
The reason it did not work (does not contain a CLI Header) is that it is a native app, rather than a .NET managed app. These do not work with reflection.
As regards your .NET apps, the best you can do is obfuscate[^] it.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Correct. I will just add that it's still of course possible to disassemble any application; a native app just requires a native disassembler rather than a .net one. And native apps don't contain the metadata to reconstruct high-level code like .net apps do.
So it would seem an alternative to obfuscation could be to write your secret code in C++ and compile it natively, then create a .net assembly that is a thin wrapper to use this native .dll in your .net apps. But it's not an attractive route to go imo if you're a .net programmer, especially if you haven't made native apps before and don't plan to do so anyway.
Isn't copyright enough?
|
|
|
|
|
dojohansen wrote: Isn't copyright enough?
Um. I can think of a few sites that have been on the news recently that imply not...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Ok. Thanks.
I went over the documentation u gave me and will try to work something out.
Thanks for your help!
Regards,
Matjaž
|
|
|
|