Reg cross-thread operation:
===========================
Hi it seems you are trying to access the properties
of a control from a different thread. This operartion
will throw an exception because the properties of
windows controls are not thread safe. So you have to
marshall the calls between interthread operation.
Try this sample code:
MethodInvoker mi = new MethodInvoker(this.update);
try
{
this.BeginInvoke(mi);
}
catch(ThreadInterruptedException exp)
{
MessageBox.Show(exp.Message);
}
// update is a method which accesses the properties of
controls.
Hope this help you.
******************************************************
Re:HOW TO USE LOCK TYPE IN .NET(C#,VB.NET)
==========================================
You can lock crucial resource from accesssing by some
other thread when it is used.
The syntax is
lock(this.txtRead)
{
txtRead.text= "WELCOME TO C#";
}
This will protect your textbox from being used by
other objects during this process.
In order to lock the entire object you can use
lock(this)
{
}
*****************************************************
Regards,
Karthikeyan V
--- [email protected] wrote:
>
> There are 8 messages in this issue.
>
> Topics in this digest:
>
> 1. cross-thread operation
> From: "sabeelca" <[EMAIL PROTECTED]>
> 2. httpwebrequest and
> authentication/authorization
> From: "hobbit_jr" <[EMAIL PROTECTED]>
> 3. Re: Security of a Win App?
> From: Chris Cottrell
> <[EMAIL PROTECTED]>
> 4. RE: Security of a Win App?
> From: "Stephen Russell"
> <[EMAIL PROTECTED]>
> 5. TWO DATAREADER WITH ONE CONNECTION
> From: "rkmnm" <[EMAIL PROTECTED]>
> 6. HOW TO USE LOCK TYPE IN .NET(C#,VB.NET)
> From: "rkmnm" <[EMAIL PROTECTED]>
> 7. HOW TO MOVE TEXT BOX ON LISTVEW
> From: "rkmnm" <[EMAIL PROTECTED]>
> 8. Re: HOW TO MOVE TEXT BOX ON LISTVEW
> From: Chris Cottrell
> <[EMAIL PROTECTED]>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 1
> Date: Mon, 04 Apr 2005 08:56:20 -0000
> From: "sabeelca" <[EMAIL PROTECTED]>
> Subject: cross-thread operation
>
>
> Hello!
>
> I'm coding for client-server applications. In server
> application,When
> client joins, a method is invoked. In this invoked
> method,I have a
> statement label2.text ="client joined"; ---label2 is
> on my form to show
> a text "client connected", ...the error message i
> get is "illegal cross-
> thread operation: Control 'label2' accessed from a
> thread other than
> the thread it was created on.
>
> How can i solve the problem?
>
> Thanks.
>
>
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 2
> Date: Mon, 04 Apr 2005 10:45:06 -0000
> From: "hobbit_jr" <[EMAIL PROTECTED]>
> Subject: httpwebrequest and
> authentication/authorization
>
>
> Hi All,
>
> Can anyone tell me the difference?
>
> Scenario:
>
> I have an aspx page on my computer that runs IIS. It
> uses SSL and MS
> Basic Authentication scheme for
> authentication/authorization.
>
> Below are two ways my webclient is written (using
> httpwebrequest):
>
> 1) .....
>
> HttpWebRequest httpRequest =
> (HttpWebRequest)WebRequest.Create
> (m_uri);
>
> string cred = String.Format("{0}:{1}", "username",
> "password");
>
> byte [] bytes =
> System.Text.Encoding.ASCII.GetBytes(cred);
>
> string base64 = Convert.ToBase64String(bytes);
>
> httpRequest.Headers.Add("Authorization", "Basic " +
> base64);
>
> HttpWebResponse response =
> (HttpWebResponse)httpRequest.GetResponse
> ();
>
> 2).....
>
> HttpWebRequest httpRequest =
> (HttpWebRequest)WebRequest.Create
> (m_uri);
>
> NetworkCredential cred=new
> NetworkCredential("username","password");
>
> httpRequest.Credentials = cred;
>
> HttpWebResponse response =
> (HttpWebResponse)httpRequest.GetResponse
> ();
>
> Firstly, solution (2) works while solution (1)
> doesnt. I get
> an "Unauthorized" error with solution (1). Aren't
> they the same? I'm
> assuming the "Network Credentials" class in solution
> (2) hides all
> the nitty-gritty details of solution (1). Am i
> right?
>
>
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 3
> Date: Mon, 4 Apr 2005 08:33:12 -0500
> From: Chris Cottrell <[EMAIL PROTECTED]>
> Subject: Re: Security of a Win App?
>
> Hi,
> Can you explain what doesn't work about the utility?
> Getting a specific error?
>
> On Apr 2, 2005 10:24 PM, Stephen Russell
> <[EMAIL PROTECTED]> wrote:
> >
> > I have an app that needs to cross boundaries to 2
> different boxes for data,
> > and an FTP file. Data is paradox and my utility
> to index that data doesn't
> > work from the server I have my app installed on,
> it will only run from the
> > same server that holds the data.
> >
> > This is an active directory location with Server
> 2000 or Server 2003 OS's
> > depending.
> >
> > I think that this is a security issue. I am
> running on the server as the
> > sites administrator, per their only way of
> thinking of doing things.
> >
> > Stephen Russell
> > S.R. & Associates
> > Memphis, TN 38115
> >
> > 901.246-0159
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 4
> Date: Mon, 4 Apr 2005 08:55:52 -0500
> From: "Stephen Russell" <[EMAIL PROTECTED]>
> Subject: RE: Security of a Win App?
>
> Chris Cottrell wrote:
> > Hi,
> > Can you explain what doesn't work about the
> utility? Getting a
> > specific error?
>
> External data = Paradox. Here is the conncetion
> string:
> "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=u:\USR2\EDCAT\TABLES\;Extended
> Properties=Paradox 4.x;"
>
> I have also tried the \\ServerName instead of U:\
>
> The JIT debugger starts it's spew. I then can read
> a button call was made,
> I calls a pull for data to populate a dataset table
> and then use that for a
> grid. I percolate through the lines of that, and
> here they are:
>
> System.Data.OleDb.OleDbException: Unexpected error
> from external database
> driver (11270).
> at
>
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
> hr)
> at
>
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
> dbParams, Object& executeResult)
> at
>
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> executeResult)
> at
>
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> behavior, Object& executeResult)
> at
>
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> behavior, String method)
> at
>
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior
> behavior)
> at
>
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandB
> ehavior behavior)
> at
>
System.Data.Common.DbDataAdapter.FillFromCommand(Object
> data, Int32
> startRecord, Int32 maxRecords, String srcTable,
> IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet
> dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable,
> IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet
> dataSet)
> at SRA.EdCat.UpDate.FixData(DataSet DS, String
> lcSQL)
> at SRA.EdCat.UpDate..ctor()
> at
>
SRA.EdCat.Main.Windows.Forms.MainForm.menuItem1_Click(Object
> sender,
> EventArgs e)
>
>
> TIA
>
> Stephen Russell
> S.R. & Associates
> Memphis, TN 38115
>
> 901.246-0159
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 5
> Date: Mon, 04 Apr 2005 18:12:29 -0000
> From: "rkmnm" <[EMAIL PROTECTED]>
> Subject: TWO DATAREADER WITH ONE CONNECTION
>
>
> DEAR
> IT IS POSSIBLE TO OPEN TWO DATAREADER WITH SAME
> CONNECTION
> AS SAME TIME IF POSSIBLE THEN PLEASE GIVE ME THE
> CODE HOW
> TO DO IT
>
>
> THANKS
> RAVI MITTAL
>
>
>
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 6
> Date: Mon, 04 Apr 2005 18:20:34 -0000
> From: "rkmnm" <[EMAIL PROTECTED]>
> Subject: HOW TO USE LOCK TYPE IN .NET(C#,VB.NET)
>
>
> DEAR
> PLEASE HELP ME HOW TO HANDLE LOCK TYPE IN C# OR
> VB.NET
> IF POSSIBLE THEN GIVE ME OF SOURCE CODE
>
> THANKS
> RAVI MITTAL
>
>
>
>
>
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 7
> Date: Mon, 04 Apr 2005 18:23:42 -0000
> From: "rkmnm" <[EMAIL PROTECTED]>
> Subject: HOW TO MOVE TEXT BOX ON LISTVEW
>
>
> DEAR
>
> ANY ONE HELP ME HOW TO MOVE TEXT BOX ON THE
> LISTVEW CONLUMNS
>
>
> THANKS
>
> RAVI MITTAL
>
>
>
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
> Message: 8
> Date: Mon, 4 Apr 2005 14:28:55 -0500
> From: Chris Cottrell <[EMAIL PROTECTED]>
> Subject: Re: HOW TO MOVE TEXT BOX ON LISTVEW
>
> Hi,
> First of all, you may want to learn how to use the
> lowercase on your
> keyboard. Second, you may want to learn how to use
> something called
> google to search for answers first so you can come
> to the group when
> you have road blocks. Third, I don't know what the
> hell you are
> asking here. Fourth, there are a string of
> questions you asked the
> first couple ones simple (this one makes no sense),
> but you need to
> learn to do things for yourself. Move textbox on
> listview columns? I
> forgot my crystal ball. Can anyone else decipher
> what is needed.
>
> Chris
>
> On Apr 4, 2005 1:23 PM, rkmnm <[EMAIL PROTECTED]>
> wrote:
> >
> >
> > DEAR
> >
> > ANY ONE HELP ME HOW TO MOVE TEXT BOX ON THE
> LISTVEW CONLUMNS
> >
> > THANKS
> >
> > RAVI MITTAL
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
>
________________________________________________________________________
>
________________________________________________________________________
>
>
>
>
------------------------------------------------------------------------
> Yahoo! Groups Links
>
> http://groups.yahoo.com/group/Microsofts_C_Sharp/
>
> [EMAIL PROTECTED]
>
>
>
------------------------------------------------------------------------
>
>
>
>
>
Karthikeyan V
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Microsofts_C_Sharp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/