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


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

Open method works with one app, crashes with another

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :Sql Server
 
Fairly straightforward. I do:         public static SqlConnection DBConnection;             try             {                 string sqlConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;                 DBConnection = new SqlConnection(sqlConnection);                 DBConnection.Open();             }             catch (Exception ex)             {                 MessageBox.Show("Error starting application: " + ex.Message + Environment.NewLine + ex.InnerException.Message);             } In one app, this works fine. In another, which uses the exact same code copied to the app that works this throws up the old "<app> has encountered a problem and needs to close" dialog. The Connection object is not null and I've narrowed it down to the Open method line. I'm stymied as to why this is happening. First, why is the problem not being caught? Second, the "What data does this erro


View Complete Post


More Related Resource Links

Cash Drawer - Method Open threw an exception - Windows Service

  
Hi All, I'm getting the following exception while calling Open method of Cash Drawer object. Method Open threw an exception.  Could not read the device name key's default value, or could not convert the Programmatic ID it holds into a valid Class ID. Code:   class Class1 { CashDrawer _uniCashDrawer1 = null; DeviceInfo cashDrawerDevice1 = null; PosExplorer posExplorer = new Microsoft.PointOfService.PosExplorer();   public void ClaimCashDrawer() { cashDrawerDevice1 = posExplorer.GetDevice("CashDrawer", "testDrawer"); if (cashDrawerDevice1 != null) { _uniCashDrawer1 = posExplorer.CreateInstance(cashDrawerDevice1) as CashDrawer; if (_uniCashDrawer1 != null) { _uniCashDrawer1.StatusUpdateEvent += new StatusUpdateEventHandler(UniCashDrawer1_StatusUpdateEvent); _uniCashDrawer1.Open(); _uniCashDrawer1.Claim(0); _uniCashDrawer1.DeviceEnabled = true; } } } }   Tha above code works fine if you put the code in WindowsApplication in all POS systems. The same is working if you put the code in Windows Service in all other POS systems. The same is not working if you put the code in Windows Service in Aures Galeo POS systems.  Thanks in advance. Ramakrishnan S

Query crashes in MSAccess 2007 and 2010 on Windows 7 64bit, but works on 32 bit

  
Hello. I have a prepared a Database that contains 2 tables, and a Query. If you execte the query (Just a very simple join with a few where statments) Windows 7 crashes in 64 bit, but not on a 32 bit platform. Unfortunatly the Database has 300MB and is to big to be uploaded here. So if there is anyone interested at MS to get my Database, please feel free to contact me serge.dornseiffer@sdna.lu

GridView crashes when user enters html open "<" or close ">" characters in a textbox

  
My GridView is bound to a sql data source and allows editing of fields. Coding is in C# and JavaScript. Using Visual Studio 2008 in test mode, if I enter a less-than "<" or greater-than ">" character in a GridView textbox an error is immediately thrown upon pressing enter: "Microsoft Visual StudioMirosoft JScript runtime error:Sys.WebForms.PageRequestManagerServerErrorException: An unknown erroroccurred while processing the request on the server. The status dode returnedfrom the server was: 500"When the < or > is entered in production, the page aborts and loads the application start page. I need to be able to catch and replace those characters BEFORE the error is thrown. I've tried hooking OnTextChange code to the textboxes, but the error is thrown as soon as I press enter...the OnTextChange code never runs. Any help will be greatly appreciated.

Generated MainWindow.xaml crashes VS2010 when you open the designer

  

In my system which is running Windows 7 Enterprise X64 I have a problem viewing some XAML files. At least one of my project XAML files sometimes crashes VS2010 if I open it in the designer or try to view it with Internet Exlorer 8 or Windows Presentation Foundation host. It also happens if i try to display the MainWindow.xaml that is generated by VS 2010.

The contents of MainWindow.xaml are

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
       
    </Grid>
</Window>

 

If I open the debugger when IE8 crashes, the failing stack frame is iefdm2.dll!03992071()

I assume it is some sort installatioin snafu or something but I would hate to have to re-install everything.

Can anybody suggest what the issue might be?


Generated MainWindow.xaml crashes VS2010 when you open the designer

  

In my system which is running Windows 7 Enterprise X64 I have a problem viewing some XAML files. At least one of my project XAML files sometimes crashes VS2010 if I open it in the designer or try to view it with Internet Exlorer 8 or Windows Presentation Foundation host. It also happens if i try to display the MainWindow.xaml that is generated by VS 2010.

The contents of MainWindow.xaml are

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
       
    </Grid>
</Window>

 

If I open the debugger when IE8 crashes, the failing stack frame is iefdm2.dll!03992071()

I assume it is some sort installatioin snafu or something but I would hate to have to re-install everything.

Can anybody suggest what the issue might be?


SQL Server Management Studio crashes when browsing to open a file...

  

SSMS has started crashing on me frequenly in the last 24 hours--perhaps related to the latest round of updates?  It always happens when I'm attempting open a file and browsing to it.  This behavior seems new.

 

This is the dialog box I get:

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Dialog: Microsoft SQL Server Management Studio

 

Microsoft SQL Server Management Studio has encountered a problem and needs to close.  We are sorry for the inconvenience.

 

If you were in the middle of something, the information you were working on might be lost.

 

DEBUG button                                                              CLOSE button

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Current sta

Windows Server 2008 R2 - "Open in Windows Explorer" only works in special cases

  

Hi

I am running SharePoint 2007 off a Windows 2008 R2 server and it seems to be running fine.

We're using another Windows 2008 R2 server for clients to login to (using remote desktop) and connect to the SharePoint site. However, whenever a client tries to use the "Open in Windows Explorer"-feature when handling documents, nothing happens. I have run through all the posts here and checked that all services, webdav modules, etc. are as they should be.

I found a fix recently, but it does not make a lot of sense. If I go directly to the site after logging in, it does not work (as expected). However, if I type in the direct path to the documents folder, \\sitename\cases, it opens just fine and if I open a new browser AFTER that, the "Open in Windows Explorer" feature now works perfectly fine.

Is there some way to fix this behavior other than adding a "net use" command to all startup scripts for all the users? It seems like I'm circumventing the problem rather than fixing it.

EDIT: We disabled UNC paths (because of security issues on the client server), but even if we tells you the path is disallowed, simply typing it in triggers the function to work (and still gives you access through SharePoint). Very odd.


FtpWebRequest GetResponse().GetResponseStream() method not works during VPN connection

  

Hi,

One of my client is providing FTP Acess over VPN Connection.
Whenever i try to use FtpWebRequest object.GetResponse().GetResponseStream() throws error message "fil not found,no acess,..."something like that.
But if try using explorer it lists the files and directories.


I found the "Proxy" property is available for FtpWebRequest object.
can anyone help how to use this Proxy property or is there any other way to connect FTP to list a file using c#.

What is the difference between using WebRequestMethods.Ftp.ListDirectoryDetails in c# and exploring files through windows explorer .

 

Is there any way to list the files of ftp using VPN connection. I connected the VPN manually. But i want to connect only FTP through C#.


FtpWebRequest GetResponse().GetResponseStream() method not works during VPN connection

  

Hi,

One of my client is providing FTP Acess over VPN Connection.
Whenever i try to use FtpWebRequest object.GetResponse().GetResponseStream() throws error message "fil not found,no acess,..."something like that.
But if try using explorer it lists the files and directories.


I found the "Proxy" property is available for FtpWebRequest object.
can anyone help how to use this Proxy property or is there any other way to connect FTP to list a file using c#.

What is the difference between using WebRequestMethods.Ftp.ListDirectoryDetails in c# and exploring files through windows explorer .

 

Is there any way to list the files of ftp using VPN connection. I connected the VPN manually. But i want to connect only FTP through C#.


Word 2010 Crashes When Trying to Open/Download File From SharePoint 2010 Using IE8

  

Hi!

I'm trying to find a solution to an issue I'm having with Word 2010/SharePoint 2010/ and IE 8 working (or rather not working) together.

I'm using Windows XP, and I have recently upgraded from Office 2007 to Office Pro 2010, in doing so, I can no longer open Word 2010 .doc or .docx files via our SharePoint site using IE8.  I can however, open these files without a problem using Chrome and Safari.  I would prefer to use IE8, as it provides better functionality in other areas for SP.

I have tried the following:

  • Unistall/Re-install of SharePoint Designer, IE8 and Office Pro 2010.
  • Ran the repair and config on Office 2010
  • Reset the IE security settings.
  • Unchecked the "automatically detect settings" box under the LAN connections.
  • Added our SP site to Trusted Sites
  • Disabled each view under Protected View in Word Options Trust Center.
  • Checked the Save settings under Word Options Save.

 - all steps either together or separate to no avail!

For a bit more detail - here's the error I'm receiving:
"Microsoft Word has encounted a problem and needs to close.  We are sorry for the inconvenience."
AppName: winword.exe      AppVer: 14.0.4734.1000     AppStamp:4b58fb0e<

My Infopath form works when edited in Infopath but crashes when I try to edit in a browser

  

Hi,

I've created an Infopath 2010 form template that includes external data sources (External Sharepoint Lists) and C# managed code.  When I ran in debug mode it worked and I was able to debug it.  I had problems running it as a Sandbox solution (wouldn't connect to the data sources (my external lists) I had configured... kept saying it couldn't find the endpoint but it worked in debug mode).

I switched to the Administrator approved option and was able to load the form and data connections centrally.  Now I can access the form in my site collection... that's where the fun starts.  When I edit in Infopath, it connects to all data sources and displays the form just fine!  Problem is, I need it to run as a browser form which doesn't work and consistently throws the following error:

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web applicat

Cannot open adventure-works.com to learn sharepoint 2007 through virtual lab

  
Actually i am trying to learn sharepoint 2007 through MSDN virtual lab (http://msdn.microsoft.com/en-us/cc707678) and in vitrual lab module 1 it says to go to adventure-works.com to register as new user but when i enter adventure-works.com web page directs me to microsoft.com. Can any body help me to fix this?

Thinking about new C# method prototypes: object as dictionary

  
I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

How To Open Fancy Tooltip from GridView

  
This article will show How To Open show Fancy Tooltip in GridView.

Code works on aspx but not ascx

  

Not sure which category to put this question in, so I will put it in here.

Just to give you an idea of the layout of my solution, I have the main project, along with 2 class libraries, BLL and DAL.  (Business Logic Layer and Data Access Layer)

The BLL refers to the DAL and the main project refers to the BLL.


I had a test website and the code worked fine, but the same code will not work on the real project. The only difference is that in the test project, the code was on an aspx code behind, whereas in the real project, it is an ascx code behind (Web User Control )

The code is:

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString
        Dim recordEntry As New UserRecord(connectionString)
        recordEntry.UserName = "TestName"
        recordEntry.BMI = bMI
        recordEntry.BMR = bMR
        recordEntry.FTM = fTM
        recordEntry.TDEE = tDEE
        recordEntry.TodayDate = dateForToday
        recordEntry.InsertRecord()



Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString

Open ModalPopup dialog on page load

  

Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?


Sys.Net.WebServiceFailedException: The server method '' failed with the following error:

  

 Hello...

Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

[WebMethod]
        public static string aaa(int i)
        {
            Thread.Sleep(1000);
            return i.ToString();
        }

        [WebMethod]
        public static string aaa1(int i)
        {
            Thread.Sleep(1000);
            return i.ToString();
        }

 

 

<div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <span id="displayspan"></span>
        <br />
        <input type="button" value=
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