|
You must set the Multiline property to true.
|
|
|
|
|
Use RichTextBox instead of TextBox.
For new line, use "\n"
|
|
|
|
|
Thanks..It Works Properly
Rahul Kulkarni
|
|
|
|
|
\n would work fine on Windows, but if your program is expected to be platform independent, use System.Environment.NewLine instead.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Set the MultiLine property to true, then \n will work.
Wasif Ehsan
|
|
|
|
|
Set the MultiLine property to true and to create a new line, you can use \r\n.
|
|
|
|
|
How can I get my app to display as a mini toolbar in Windows? (Like the one Windows Media Player uses)
It must be fixed to the toolbar on the bottom of the screen.
|
|
|
|
|
i want gene a rpt for c# file using crystal reports database:sqlserver
|
|
|
|
|
Good luck with this.
If you run into any problem with this and have any questions, feel free to ask them here in the forum.
---
b { font-weight: normal; }
|
|
|
|
|
hi all,
just wondering the best approach to the following situation:
I have a third party product that uses MS Access as backend and I am developing an application to enhance that program but I will use SQL database.
What is the best approach to obtain a readonly copy of the third party access database?
Do I just copy the database file then read that into my own application, then delete the copied file?
or
Can i open a read only connection to the MS Access database without disturbing the hosting applications access to the database?
There is no way that I can incorporate the functionality of the existing program into my own [clients budget does not allow for this], although this would be the ideal situation.
I also cannot write to the Access database as the host application fails whenver I change any fields within the database.
I would like to ensure that no data corruption comes about from my application accessing the MS Access databse file.
kind regards,
g00fy
|
|
|
|
|
Hi,
I have an activex control which is written in UnManaged code with the following prototype
void CSimpleAdditionAtxCtrl::VarMethod(VARIANT* VarParam)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
}
From the C# i want to call this mwthod
[MarshalAs(UnmanagedType.AsAny)] object fieldIdSA = new string [5];
private void cmdSimpleAddition_Click(object sender, System.EventArgs e)
{
string[] myIntArray = new string[5];
fieldIdSA = myIntArray;
axSimpleAdditionAtx1.VarMethod (ref fieldIdSA); //Call UnManaged Method.
}
Which gives "Type Mismatch" whats wrong with this, please provide me alternate solution.
|
|
|
|
|
Hi all
Just for background information, I'm only just starting out with .NEt C# programming on Excel, which means that i'm not very good at all.. [=o))..
I am trying to write a simple C# program to open up 2 excel workbooks and copy the data from one Excel workbook to another. This process is required to be repeated for more than 20times, for 20 different set of workbooks ofcourse.
I have tried out 2 different methods but both methods take extremely long to complete. I do not understand why as if I do it manually in Excel, the selecting, copying & pasting processes takes 2 seconds to complete. While with the C# program, these processes take about 30 seconds to complete.
Method 1
Create a macro for copying & pasting. Simply pass through the Selection range for copying and pasting. These macros, when run inside Excel, is extremely fast. However when called from the C# program, these macros take forever to complete.
method 2
inside the C# program, use the Range[].Copy method. This takes forever to complete as well.
Can you guys please help me out with this one. That would be absolutely great.
Thanks guys
Kind regards
Sydney_Sider
|
|
|
|
|
if you realy just want to copy the file try :-
System.IO.File.Copy(sourceFileName, destFileName);
Tamimi - Code
|
|
|
|
|
Hi Tamimi
Sorry.. I was not quite precise.. I would only like to copy data from a certain number of rows from one Excel Workbook to another Excel Workbook.
For example
Copy data from Range("A1":"M159") in Workbook A and Paste the selected range to Workbook B starting at Range("B4").
Regards
[=o))
|
|
|
|
|
I have a picturebox that I've imported an image into using the properties window. The picture shows up fine in design mode but when I run the application the image does not show up. ? ( I made sure that the visible property was set to TRUE) Any ideas !!.
|
|
|
|
|
You might not be having the rights to display image on web server.If you have made any settings in web.config file than allow all the users.
Ahsan Ullah.
Every problem has a solution.
|
|
|
|
|
i am making an outlook addin in c#. my task is to add a menuitem in a context menu whenever any stored contact is right clicked and upon clicking that menu item, call a piece of code.
i can detect whenever someone clicks on Outlook contact. but i am not finding a way to add a context menu item at this stage.
can someone please help me out on this.
.. |_|sman
|
|
|
|
|
i am trying to write this code in C#.i have a problem with Err.Number
how can i get error number in C#.
Error number is always Zero but in VB it's show the correct Error Number !!
VB.net
On Error GoTo ERROR_HANDLER
Dim TermID As Int32 = Convert.ToInt32(txtTermId.Text)
Dim EmpNum As Int32 = Convert.ToInt32(EmployeeList.SelectedItem)
objFuncs.LogIn(TermID, EmpNum, "", "")
StatusBar1.Text = "You successfully logged in with Employee " & EmpNum
ERROR_HANDLER:
MessageBox.Show(Err.Number.ToString())
Select Case Err.Number And &HFFF
Case ErrCOM_InvalidEmpPassword : MsgBox("Invalid password")
Case ErrCOM_CouldNotFindEmployeeFromId : MsgBox("Could not find employee from ID")
Case Else : MsgBox(Err.Description)
End Select
C#
try
{
int TermID = Convert.ToInt32(txtTermId.Text);
int EmpNum = Convert.ToInt32(EmployeeID.Text);
objFuncs.LogIn(TermID, EmpNum, "", "");
richTextmsg.Text += "You successfully logged in with Employee " + EmpNum;
}
catch
{
MessageBox.Show(Information.Err().Number.ToString());
switch(Information.Err().Number & 4098)
{
case ErrCOM_EmpLoggedOnOtherTerm:
MessageBox.Show("The employee is logged on to another terminal", 0, null);
break;
case ErrCOM_SomeoneAlreadyLoggedIn:
MessageBox.Show("Someone else is already logged on to this terminal", 0, null);
break;
}
|
|
|
|
|
Get the exception object in the catch statement:
catch (Exception ex)
The exception object contains information about the exception.
You can even catch only specific exceptions, or handle different exceptions separately:
try {
} catch (FormatException ex) {
} catch (Exception ex) {
} catch {
}
The Err object is a leftover from VB6, in VB.NET it's not much more than a wrapper around an exception object. You can use Try...Catch in VB.NET, just as in C#.
---
b { font-weight: normal; }
|
|
|
|
|
Hello dear programmers,
I am developing a project which require xml transfer from pc tp pda and vice versa over seial port.
i have no idea how to do it.can any body send me sample code
of serial communication between the two.
i'll be very greatful to you.
Regards
Ahsan Ullah
|
|
|
|
|
RS232 Communication can be accomplished using System.IO.Ports.SerialPort (.NET 2). As to the actual transferring of the file you'll need to be more specific as to the requirements / protocols involved. If you're writing your own protocols then it is very simple, if you're using standard protocols then it is simple also (depending on the complexity of the protocol).
Most important question, do you have control over the PDA side or is that already built-in?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I know about the ports namespace you have mentioned.I have the control over thePDA side as well.Because i am writing the application for that side as well.I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it.
Thanks a lot for your reply.
Ahsan Ullah
|
|
|
|
|
Is the serial port being used for any other purpose in the application other than sending files?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Ahsan-AhsanS wrote: I have no idea about which protocol to use.Can you kindly send me just a simple code so that i might be able to work on it.
Regarding the protocol it doesn't really matter since you control both sides you can do what you want. It all depends on what your requirements are, e.g. if you're just sending a file then all you could potentially do is open the port, send a query string, e.g. "OK?", if the PDA returns "OK" back then simply send the entire file with a checksum at the end. If the checksum matches all well and good, if not then resend.
That would be the simplest solution (although I suggest sending it in blocks of say 0x100 bytes and checksum each of these blocks so you don't have to resend the whole file.
If the serial port is being used for other stuff as well then you'd have to make it a bit more complicatated, (e.g. replace the "OK?" with "SendFile?", if it can be sent then it responds with an Ack ("OK") and you perform the previous steps).
As for the simple code, I'm sorry I don't have time, I have my first (final) A-Level module tomorrow.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Too few parameters. Expected 2
my sql string is this ,the error comes from the where clause
odbcComm.CommandText = "SELECT studenti.user_name,studenti.Nume, " +
"studenti.Prenume, cursuri.denumire_curs, note.nota, note.data " +
"FROM studenti INNER JOIN (cursuri INNER JOIN [note] ON " +
"cursuri.id_curs = note.id_curs) ON (studenti.id_stud = note.id_stud)"+
" WHERE studenti.user_name=@user AND note.data < @date";
when comparing the dates,
odbcComm.Parameters.Add(new OdbcParameter("@date",date.ToString()));
odbcComm.Parameters.Add(new OdbcParameter("@user", user));
this is how i declared my parameters,im using an Acces Database,
thanks and thanks for the answers before!
...
i put the space there but still get the error
-- modified at 15:44 Sunday 4th June, 2006
|
|
|
|