|
thanks
muhammad mahmood ilyas
|
|
|
|
|
hi all i have a pro on hand now..
i have 2 buttons in my application and i want to call up text into the richtextbook..i can do this however after pressing button 1 the text will be clear and display text will button 2.. i want both the text to remain ,how do i do it?
|
|
|
|
|
this.richTextBox.Text += newdata;
Just add your new string behind your old string in richTextBox.
|
|
|
|
|
Performance issues!
this.richTextBox.Append(newData);
Remember that strings are immutuable and doing: string += newData will create a new object everytime.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Bug issue!
At least with .NET 1.1 (didn't check 2.0), RichTextBox.Append() cuts off the text after ~32K, even though the MaxLength property has been set to a higher value! Almost got my head ripped off after we had been working with a program I wrote that suffered from this bug.
So if you have to concatenate a lot of strings, you should use a StringBuilder and then assign the whole string to RichTextBox.Text .
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Never come across that issue before (havn't filled in that much text). I agree that the best way is to use a StringBuilder first if concatenating strings programatically.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
I have made a setup for a windows application. But the problem is that it starts to re-install ( or repair I dont know since a progress bar similar to that when removing an application runs fast) when i run it for the first time. I have also used some COM components in it too since there are some AxInterop & Interop files too. Do i need to register them too. If yes, then how?
Please tell me what can be the possible problems, flaws or other descrepencies?
Regards,
Wasif Ehsan.
|
|
|
|
|
I have some c++ source code, which I have updated to compile under VS2005. When I attempt to add the code as a reference in a C# project, it states that it is not a valid .NET assemply or COM component. Also, I have tried adding the DLL in a DLLImport statement:
[DllImport("@DebugPath DLLName")]
A first chance exception of type 'System.AccessViolationException' occurred in CSharp.dll
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The DLL is in the project's bin/Debug folder.
I thought that compiling the c++ DLL in VS2005 would allow c# project to reference it. I saw another option of creating Managed c++ classes, but I didn't want to go there unless i really had to.
Am I doing something wrong?
Regards
alias47
-- modified at 1:55 Tuesday 15th August, 2006
|
|
|
|
|
C# can only reference a managed DLL. You cannot use unmanaged DLL directly to C#.
Export your function from C++, so that you can use it from C#.
|
|
|
|
|
Is Generics a .NET form of C++ Templates?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
|
|
|
|
|
It is close - Its implementation is not the same as C++ but the concepts are similar enough.
|
|
|
|
|
Hi,
I have a Typed DataSet that is bind to some winform controls. TextBox, Labelx etc....
At some point, my dataSet values are updated being the scene. The probleme is that my binded controls are not updated automatically when DataSource is updated.
What I have to do to force the rebind of my controls ?
:->
..Etienne Lefrancois
-- modified at 9:56 Tuesday 15th August, 2006
..Etienne
|
|
|
|
|
What is the best way to pass parameters in the sql statement instead
of building the sql statement with quotes and other things.
Iam using oracle at the back end. I think iam asking snippet of code
for using prepared statements and other things in oracle and c#
|
|
|
|
|
The actual method is independent of the database. Use stored procedures
IDbCommand command;
command.CommandText = "spName";
command.CommandType = CommandType.StoredProcedure;
command.Connection = connection;
command.Parameters.Add(parameter1);
command.Prepare();
while(doStuff){
parameter1.Value = "someValue";
command.ExecuteNonQuery();
}
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I want to pass variables into the sql statement itself instead of Stored Procedure. Is there a way to do that.
i.e predefine the datatype of the variable instead of building the sql statement with quotes for strings and no quotes for ints etc.
Thanks
Kal
|
|
|
|
|
Yes there is but there are numerous advantages to using stored procedures. If you really, really, really insist on using sql statements directly
"SELECT * FROM customer WHERE lastName like @name"
as command text and then append the parameters with @name as the name.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
public void InsertData()
{
OracleConnection con = GetConnection();
con.Open();
string insert = "Update STUDENT set Student_name = :stuName where Student_id = :stuId";
OracleCommand cmd = new OracleCommand(insert, con);
int rowsRet = cmd.ExecuteNonQuery() ;
MessageBox.Show(""+rowsRet);
con.Close();
}
Can you please tell me how do i pass values into :stuName and :stuId
|
|
|
|
|
After creating your command and before you execute, add your parameters.
OracleParameter opStuName = new OracleParameter(":stuName", OracleType.NVarChar);
opStuName.Value = "Joe Student";
cmd.Parameters.Add(opStuName);
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
I am facing a strange problem when I am deserializing the xml and casting to my request object. I am facing this problem on particular situation, the situation is as below
1. I have a client DLL
2. I have a interface DLL
3. I have a core DLL
The call invokes from client to interface from interface to core. In Interface I am using reflection to lookup one of the decision making class in Core DLL. In this situation I am able to send my sample XML from client to the Core DLL there I am desrializing the XML into specific object in that place it is failing.
If I write the same in single file it is working, if I place them into DLL it is not working.
Please try to simulate as i mentioned otherwise it is working.
The following peace of code faling in the core DLL.
public static NoneyaRequest PopulateXmlIntoRequestDTO(string xmlStr)
{
Console.WriteLine("Enetering PopulateXmlIntoRequestDTO:" + xmlStr);
NoneyaRequest userInfo = null;
try
{
XmlSerializer ser = new XmlSerializer(typeof(NoneyaRequest));
//StringReader sr = new StringReader(xmlStr);
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(xmlStr);
XmlNodeReader nodeReader1 = new XmlNodeReader(xdoc);
nodeReader1.Read();
//The below line is causing the problem
userInfo = (NoneyaRequest)ser.Deserialize(nodeReader1);
////The above line is causing the problem
Console.WriteLine("LI:" + userInfo.LoginAccountIdentifier);
Console.WriteLine("AId:" + userInfo.ApplicationId);
Console.WriteLine("Opp:" + userInfo.Operation);
}
catch (XmlException e)
{
throw new SecurityException(e.Message);
}
return userInfo;
}
|
|
|
|
|
try to use this:
MemoryStream memoryStream = new MemoryStream(Encoding.ASCII.GetBytes(xmlStr));
XmlSerializer ser = new XmlSerializer(typeof(NoneyaRequest));
NoneyaRequest userInfo = (NoneyaRequest) ser.Deserialize(memoryStream);
// Just do what you want with your object "userInfo"
|
|
|
|
|
|
There is no way from the .NET framework to make a thread sleep for less than a millisecond. You can call Thread.Sleep(0) which will simply cause the process to switch contexts and let another thread run for a moment before returning and processing the current thread.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Maybe the StopWatch class can help you.
StopWatch watch = StopWatch.StartNew();
while (watch.ElapsedTicks < someValue)
{
}
somevalue has to be computed from Stopwatch.Frequency to reflect the wanted amount of microseconds. Should be some easy math but I'm too lazy and also want to leave some coding for you
-- modified at 16:26 Monday 14th August, 2006
Just an annotation: This way your thread doesn't really sleep but actively waits for time to go by, so this isn't really good practice and shouldn't be used often.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
It can't be done. The Windows platform doesn't have programmable access to any hardware timers with that kind of resolution.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was wondering when someone would realise this
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|