|
Hi Senthil,
Name property will not work in this case. It should be the Text property. Name will be used as identifier and will not be displayed on button while Text is actually displayed on button. Try to change the name to "&Click". It will show invalid property dialog box. With Text property it will work smooth.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Yes, you're right. I must check the documentation before posting replies
|
|
|
|
|
I am using interop.excel dll to access my Excel 2000 thru ASP.NET Script.. The Problem is that I am not able to kill the instance of Excel with that.
Can somebody plz let me know the way to do the same !!!
|
|
|
|
|
Hi Dear Respected programmers
Kindly help me, I created a little chat server programe. whenever client attemps to send data so errer is arrising from Server side.
Error is : "Cross-thread operation not valid: Control 'textBox2' accessed from a thread other than the thread it was created on."
above mentioned problem is happinig both side. Server side and Client side.
kindly read my following code. and please tell me my mistake.
thank you in advance
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Threading;
using System.IO;
namespace Server
{
public partial class Form1 : Form
{
private Socket connection;
private Thread readThread;
private NetworkStream SocketStream;
private BinaryWriter writer;
private BinaryReader reader;
private int intCounter = 0;
private string strTheReplyer = "";
public Form1()
{
InitializeComponent();
}
public void RunServer()
{
try
{
TcpListener listener = new TcpListener(5252);
listener.Start();
while (true)
{
connection = listener.AcceptSocket();
SocketStream = new NetworkStream(connection);
writer = new BinaryWriter(SocketStream);
reader = new BinaryReader(SocketStream);
textBox2.Text += "\r\nConnection " + intCounter + " received.";
writer.Write("Server=> ok");
//string strTheReplyer = "";
do
{
try
{
strTheReplyer = reader.ReadString();
//message = strTheReplyer.Trim();
//MessageBox.Show(strTheReplyer, "Server");
textBox2.Text = strTheReplyer;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.Source);
}
}
while (strTheReplyer.ToUpper().Trim() != "CLIENT=> QUIT" && connection.Connected);
textBox2.Text += "\r\nClient gone.";
writer.Close();
reader.Close();
SocketStream.Close();
connection.Close();
++intCounter;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.Source);
//textBox2.Text += "\r\n" + Convert.ToString(ex.Source) + " " + Convert.ToString(ex.Message);
}
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode == Keys.Enter && connection != null)
{
writer.Write("Server=> " + textBox1.Text.Trim());
textBox2.Text += "\r\n" + textBox1.Text.Trim();
if (textBox1.Text.ToUpper().Trim() == "QUIT") connection.Close();
}
else
{
//textBox2.Text += "\r\n" + strTheReplyer.Trim();
}
}
catch (Exception ex)
{
textBox2.Text += "\r\n" + ex.Source + ": " + ex.Message;
}
}
private void Form1_Load(object sender, EventArgs e)
{
textBox2.Text += "\r\nWaiting for incoming client ...";
readThread = new Thread(new ThreadStart(RunServer));
readThread.Start();
//textBox2.Text += "\r\n" + message.Trim();
}
}
}
|
|
|
|
|
You can use an attribute to turn off this error. Or, you can use a worker thread which sends messages back to the main thread, whch can then update the UI.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Create a new thread while making any calls to server. Let that thread handle it. If u r using .NET 2.0, use form.InvokeRequired().
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
I am student of final year engineering student. I selected “SMS Website” as my project topic. In this I have to send Bulk SMS through website and provide other kind of services related to SMS.
Please tell me which steps I should follow.
Please send me some material or any kind of source code related to it.
I need your help.
Thank you!!!
Contact Me: ashish.0619@gmail.com
|
|
|
|
|
hi,
How to use that assembly update Version????? Pls tel me.......
Thanking you
somasundaram
|
|
|
|
|
hi,
Does any body knows how to create a new user in the active directory using the C# language.
Best regrads,
Jamil Abou Khalil
|
|
|
|
|
|
is it difficult to give the answer and make some help without being an a**hole
jamil abou khalil
|
|
|
|
|
Hello,
In one hand I do agree with you, because there are a lot of ironic answers in this forum.
But,
jamil abou khalil wrote: being an a**hole
This is much too rude.
Martin
|
|
|
|
|
And the is even not the first time, he insulted me at the beginning this week, because I said something about his 'posting the question over and over again because no answer was given'...
|
|
|
|
|
Hahahahahah
Please don't cry
jamil abou khalil
|
|
|
|
|
Search[^]
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
thank you
jamil abou khalil
|
|
|
|
|
you are welcome...
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
What? No snappy comeback or vulgarity for telling you to search?
only two letters away from being an asset
|
|
|
|
|
hi i am loading 500000 records in to a datatable and going thro each and every record. It is taking a large amount of time .
Is there any possibility or efficient ways in which we can handle it easily....less memory resouse utilization is must plzzzz
help me........
thanks.....
|
|
|
|
|
Where is the data being loaded from? Why are you loading some much? What do you mean, "going thro each and every record"? Lots of unanswered questions here.
only two letters away from being an asset
|
|
|
|
|
i am making a connection to a text file thro ODBC connectivity and filling the datatable.... tht txt file may contain records from 5000 to 500000+
i need to loop thro each record and do some processing...?
|
|
|
|
|
chandler83 wrote: filling the datatable
Do you mean the table in the database or DataTable object?
only two letters away from being an asset
|
|
|
|
|
You should prepare your data ( do the loop ) then process it to the DB all at once, or at least in batches. One DB call per record will indeed take forever.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
you can use paging to minimize the mount of data you are retrieving , or if you are searching then maybe you can do that process on the SQL Server side or whatever you are using...
|
|
|
|
|
I had to update/insert a couple of 1000's records once. What I did was concatenate the inserts (delimit with ";") and fire it up to the database at once...
eg.
"INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);...;INSERT INTO YOURTABLE (COLNAMES) VALUES (COLVALUES);"
In your case don't do it at once, but in blocks.
Hope this helps.
V.
No hurries, no worries
|
|
|
|