.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

Current thread is not STA error

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF
 

On creating media player control in my winforms whose main() function is marked as mtathread... i get below error

ActiveX control '6bf52a52-394a-11d3-b153-00c04f79faa6' cannot be instantiated because the current thread is not in a single-threaded apartment.

But I dont want to change my threading model as some other activex controls are involved...

How to fix this issue... 


- Rajesh K http://thoughtsontechies.blogspot.com/


View Complete Post


More Related Resource Links

Registering controls of current assembly object reference NOT set error

  

Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?

Thanks


Compiler Error Message: CS0103: The name 'lblRegion' does not exist in the current context

  
i am gettign this error Compiler Error Message: CS0103: The name 'lblRegion' does not exist in the current context Source Error: Line 31: {Line 32: Line 33: lblRegion.Text = dt.Rows[0]["RegionName"].ToString();Line 34: lblCountry.Text = dt.Rows[0]["CountryName"].ToString();Line 35: lblCountryCode.Text = dt.Rows[0]["CountryCode"].ToString(); this is source code:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Net;using System.Xml;public partial class CSharp : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {        //Get IP Address        string ipaddress;        ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];        if (ipaddress == "" || ipaddress == null)            ipaddress = Request.ServerV

Thread being aborted Error -- while using sqlldr

  
public sub LoaddataIntotable() _errorLogFilePath = something _badLogFilePath = something _discardLogFilePath = something credentialTokens = "connection string" objCommand.UserName = "scott" objCommand.Password = "tiger" objCommand.Host = "oracle" objCommand.ControlFile = "test.ctl" objCommand.LogFile = _errorLogFilePath objCommand.BadFile = _badLogFilePath objCommand.DataFile = _dataFilePath objCommand.DiscardFile = _discardLogFilePath objCommand.IsParallel = False objCommand.IsDirectLoad = True _objShell.Command = "SQLLDR" _objShell.Arguments = objCommand.ToString AddHandler _objShell.Exited, AddressOf OnProcessExit _objShell.Start() end sub Private Sub OnProcessExit(ByVal sender As Object, ByVal e As CommandLineProcess.ExitedEventArgs) Try If Not e Is Nothing Then If _processExited = False Then _processExited = True CommandCompleted(e.ExitCode) Exit Sub Else ' Event raised again

Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection

  
Hello All, Suddenly, the sql server is down, in the log file, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG, I found the record as follows, 2007-03-05 15:40:31.59 Logon       Error: 17189, Severity: 16, State: 1.2007-03-05 15:40:31.59 Logon       SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems. [CLIENT: 172.21.123.48] What else I can do to further investigate? Thanks Spencer

Backup failing - Error "operation is not valid due to the current state of the object" ...........Ca

  
Hi, I am having a problem backing up a site collection, when trying to backup the collection I get the following error  "operation is not valid due to the current state of the object"............. "Category Info :InvalidData" . I'm getting the same error whether I use CA "granular backup" or "Farm backup", and using either STSAMD or Powershell. I can backup CA or the mysite collection but not the Home Portal site collection. As this is a production system I am really worried that something is going to happen and I'll have no backup. Does anyone have any suggestions on what i can do to either fix the problem or an alternative way to backup the collection or farm.  P.S. I am not using the "UseSQLSnapshot" parameter. Any ideas ? 

A severe error occurred on the current command. The results, if any, should be discarded

  
I m using MOSS 2007 and sql server 2008n. when i expand the database from 100 GB to 500 GB, i get the following error message:- A severe error occurred on the current command.  The results, if any, should be discarded. Any idea about this error in sharepoint. I have found many articles but all are related to sql server only. There are some hot fixes available for same problem but don't know, which one is right for this problem. Any help would be appreciated. Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"

OPENQUERY Error when calling usp - object has no columns or the current user does not have permissio

  
Hi Guys, I need to get data using a usp, but getting error: Cannot process the object "EXEC BKS..uspPayments @paymentTypeCode1 = '1', @paymentTypeCode2 = '2', @paymentTypeCode3 = '3';". The OLE DB provider "SQLNCLI" for linked server "SERVER" indicates that either the object has no columns or the current user does not have permissions on that object. I am trying the script below: use myDB; select * from OPENQUERY([SERVER], 'EXEC myDB..uspPayments @paymentTypeCode1 = ''1'', @paymentTypeCode2 = ''2'', @paymentTypeCode3 = ''3''; ') Thanks in advance for any help. Everything is possible, impossible just takes longer

A severe error occurred on the current command. The results, if any, should be discarded.

  
I am running this basic query on my database, this table has ~ 130k rows with around 10 columns.  I am running it in my management studio.  I restart my MSSQLSERVER and it worked again but I am afraid it will come back up, how can I debug this issue? SELECT * FROM Table1 Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.  

A severe error occurred on the current command. The results, if any, should be discarded

  

Hi ppl,

I m using MOSS 2007 and sql server 2008 SP2. I increased  the database from 100 GB to 500 GB, after increased teh database size, i am getting following error message:-
A severe error occurred on the current command.  The results, if any, should be discarded.

I am having this issue with only with particular content database. I have checked some stored procedure and tables and i have found this error with 

"SP_GetCurrent" stored procedure and "dbo.EventCache" table.

Any idea about this error. There are some hot fixes available for same problem but when i am trying to install below hotfix on database server it is saying..

http://support.microsoft.com/kb/971490/en-us

"You have already install updated version". but i have not install any hotfix on server

Any idea about this error.


Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"

ORDER BY clause causes 'A severe error occurred on the current command. The results, if any, shoul

  

Hello,

I'm trying to execute the following:

SELECT STATE_CODE5
  FROM qaeda.R727702b.NF29005
  WHERE STATE_CODE5 IN ('IL','NV','VA','NH','HI')
  InTERSECT
  SELECT STATE_CODE8
  FROM qaeda.r727702b.NF29008
  WHERE STATE_NAME8 = 'HAWAII'
 ORDER BY STATE_CODE5;

In both 2005 and 2008 versions of the SQL Server the query parses ok, but on execute I get the following error:

Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.

If I remove the the 'ORDER BY' clause, I am able to execute the query with no problem. 

I've searched the forum and I know this error comes up often in various circumstances, however I didn't see anything similar to this.  Please advise, maybe I'm writing the query incorrectly?  Thanks

 

 


ORA-00255: error archiving log of thread , sequence #

  

Hi

I have the above error when filling a dataset from an oledbconnection into a dataset

 

 I have had a shorter version of the query working fine

 

the query works fine in the oracle client

 

any ideas

 

thanks in advance


How to resolve this error? - Database on SQL Server instance is not empty and does not match current

  
Upgrade form MOSS 2007 to Sharepoint 2010.  Reviewing the event log I see the following error.  Not sure what to do and hoping someone can provide some guidance please.

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name

Unable to cast COM object error when calling COM from .NET C# worker thread

  

I'm having an issue calling a COM object function from .NET C# client program. The COM object is written in C++ unmanaged. The problem only appears when I'm calling from a worker thread, it works fine if I call it from the UI thread. This is the error:

Unable to cast COM object of type 'gvAgileFileReaderLib.gvAgileFileReaderClass' to interface type 'gvAgileFileReaderLib.IgvMpiRead'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{616B5C39-C7FB-4C8C-85D4-27559DD83304}' failed due to the following error: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).

I have tried the following methods but all of them fails:

1) Create the COM object on UI thread, and call its function via its interface (IgvMpiRead) in the worker thread

2) Create the COM object on the worker thread & access its function from worker thread

3) Tried with worker thread set to STA & MTA

I need to use the COM function is a worker thread to prevent a long processing from holding up my UI, but it just doesn't work when I try to call the COM function inside the worker thread.

The weird thing is that doing the same from a unmanaged C++ client works fine (I can create the com object on UI, and then call its function from worker thread). Is this problem caused by inter

Label does not exist in the current context error

  

Hello All,

I am facing a weird issue.I have a label on the front end but when I try to use it on the code-behind and run my code I obtain an error: Label does not exist in the current context! The label is shown in intellisense and was working earlier.My team mate had created a back up of the file and it stopped working after that.I deleted the back up files and tried but it doesn't seem to work.Any suggestions will be greatly appreciated.


The following is the code snippet of the front end as well as the code behind:


 <div id="weather">
     <img src="sunny.jpg" alt="sunny" height="40px" width="40px"/>
     <h3>Weather</h3>
     <p><i>(5 minute Averages)</i></p>
     <table>
      <tr>
            <td><b><font size="2px">Current Time</font></b></td>
            <td><asp:Label runat="server" ID="Label_Time"></asp:Label></td>
       </tr>
       <tr><td><b><font size="2px">Temperature</font></b></td><td><asp:Label runat="server" ID="Label_Temperature"></asp:Label></td>
       </tr>
    

Error 17120 - SQL Server could not spawn process_loginread thread

  

Hello,

Some how my web server is going down every time I got this error on SQL Server (Error 17120 - SQL Server could not spawn process_loginread thread). I read the related topic but none of those similar issues are related to me (i.e. my protocols are not disabled)

Here is the complete detail of Event Viewer Log:
Event Type: Error
Event Source: MSSQLSERVER
Event Category: (2)
Event ID: 17055
Date:  12/23/2009
Time:  6:27:22 AM
User:  N/A
Computer: EBS_SERVER
Description:
17120 :
SQL Server could not spawn process_loginread thread.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Byte Data:
0000: e0 42 00 00 10 00 00 00   àB......
0008: 0b 00 00 00 45 00 42 00   ....E.B.
0010: 53 00 5f 00 53 00 45 00   S._.S.E.
0018: 52 00 56 00 45 00 52 00   R.V.E.R.
0020: 00 00 00 00 00 00         ...... 
Words Data:
0000: 000042e0 00000010 0000000b 00420045
0010: 005f0053 00450053 00560052 00520045
0020: 00000000 0000

The only thing to do in order to get my website up and working again is to restart the computer. Neither rest

A severe error occurred on the current command. during data save

  

I am using Sql Server 2005.

When I save data, I get an error message

 

A severe error occurred on the current command.  The results, if any, should be discarded.

what is the problem ? how to resolve this problem ?


Stsadm Backup/Restore Error! "operation is not valid due to the current state of the object "

  

Hi,

I am facing problem while taking a backup of my SharePoint 2010 site using stsadm command after taking 75% backup it shows "operation is not valid due to the current state of the object " error message. While it is working on my different sharepoint server. I am using SharePoint 2010 RTM.


Thanks & Regards, Satish Srivastava
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend