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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SqlClient Connection Works Fine with XP, will not work on Windows 7

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework

Hello, I am programming in VS2010 wirting a simple windows forms program. I am using the System.data.SqlClient for a connection. My data Connection code:

'Used for reading data only



Public Function O

View Complete Post

More Related Resource Links

Toggling of iFrames works fine in Firefox but not in IE


I have different iFrames on my page and one of the iFrame has pdf plugin that shows the PDF document and i have another iFrame that pops up on delete button click and  a function to toggle the iFrames. It works fine in Firefox but in IE my pop up iFrame is always behind the PDF. 
Any thought how can I set it right, there is some issue with the z-index of PDF, it is set to infinity something like that in IE ! 


Javascript fails in chrome and firefox, works fine in IE



I am customizing Newform.aspx i.e. hiding some fields, making other readonly etc. It works fine in IE but fails miserably in chrome and firefox i.e. readonly are no more readonly, hidden are no more hidden. Here is my code:

<script language="javascript" type="text/javascript">
    function autoFillFields()
       var ctrl = findacontrol("Reference Customer");
    var param = getURLParam('RefFromCust');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;
    var ctrl = findacontrol("RefReqOpptyId");
    var param = getURLParam('OpptyId');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;

    param = getURLParam('RefFromAE');
    properParam = replaceCharacters(param);
    setPeoplePicker("People Picker", properParam);
    hideFldCtrl("Approval Sta

this my query works fine, i need to eliminate when resultset zero

hithis is the query working fineSELECT a.Selection,a.SizeRange,a.Thickness,       ISNULL(a.Assotment,0) - ISNULL(b.Issue,0)  AS difference1      FROM ( SELECT Selection,SizeRange,Thickness,                SUM(Pcs) AS Assotment            FROM  dbo.WBCAssortDescp where LotNo='LWC2'          group by Selection,SizeRange,Thickness) AS a LEFT OUTER   JOIN (SELECT Selections,SizeRange,Thickness,                SUM(Pieces) AS Issue            FROM dbo.WBIssue Where LotNo='LWC2'           group by Selections,SizeRange,Thickness) AS b on b.Selections=a.Selection and b.SizeRange=a.SizeRange and a.Thickness=b.ThicknessSELECT a.Se,a.Si.Th,      ISNULL(a.ent,0) - ISNULL(b.Ise,0)  AS difference1   FROM ( SELECT Se,Si,Th,               SUM(Pcs) AS ent           FROM  dbo.Table1where No='C2'         group by Se,Si,Th) AS aLEFT OUTER  JOIN (SELECT Ses,Si,Th,               SUM(Pieces) AS Ise         &nbs

Getting AppDomain.UnhandledException event to work in a Windows Service

Nearly every forum thread I have found on "catching unhandled exceptions in a service" seems to end up where I am.  The supposed solution is the use of the AppDomain.CurrentDomain.UnhandledException event.  But it doesn't work for someone, who then asks why and gets no answer.  Same for me; I can't get the event to happen.  It's as if I need the ServiceProcess version of Application.SetUnhandledExceptionMode(), which doesn't exist. For diagnosing this, I start a timer in a child object of the service and then throw an exception in the timer event handler.  Simple enough to simulate the real situation.  I have tried subscribing to the UnhandledException event in at least a half dozen locations throughout the service, from the Program that runs ServiceBase.Run() to the constructor of the object that owns the Timer, but it never catches this exception. The VS debugger recognizes that the forced exception is unhandled and takes me to the place where is thrown, letting me know it is an unhandled exception. Why doesn't my handler catch it?  Running without the debugger, the exception throws, the timer thread crashes, the service continues merrily along, and nothing gets logged anywhere.  That is NOT the result I need.  What are the people for whom this works doing that I am not doing? How can I at least get the offe

Getting my sql database app to work on any windows pc

Hello I have just made a vb.net database application using visual studio 2008 with the service based database component. The application works fine on my pc but when i copy my application and the .mdf file and test it on another windows pc that does not have visual studio 2008 installed it  says that sql server is not propery configured and or is missing. I am just wondering how I can configure the sql server so that my application can read,save,add, delete my stored data on any pc. I tried to install the sqlsetup files but I still get the same error message. Would appreciate if someone could give some hints or help with this issue. Thanks!    

logoff doesn't work through windows service

Dear Friends, I am facing this problem on Windows 2003 and 2008 Server. On XP it works fine. I have written and Windows Service that takes receives the command and executes tasks such as Logoff, Shutdown, etc. All the commands except Logoff works fine. I tried following ways to perform the Logoff. However it didnt work. Try 1:                 Process.Start("shutdown", "-l"); Try 2:     [DllImport("user32.dll")]     public static extern int ExitWindowsEx(int uFlags, int dwReason);     ExitWindowsEx(0, 0); Try 3:     Process _currentProcess = new Process();                _currentProcess.StartInfo = new ProcessStartInfo("shutdown", "-l -f");                _currentProcess.StartInfo.UseShellExecute = false;                 _currentProcess.Start(); Try 4:     Process.Start("logoff.exe", null); If I write a simple C# based applicatin (not Service) it works fine for all the tries that I have made. I am facing this problem only when I put this code

How to impersonate a connection to SQL server under IIS app pool account if Windows Authentication i

I have a requirement I should connect to MS SQL server under IIS Application pool account from ASP.NET application where Windows Authentication is enabled. I cannot use user name and password in connection string. ASP.NET application should use Entity Framework 4.0 to work with data. Any ideas how to do it?    

Connection to Exchange Server of .NET 1.1 Framework application on Windows 2008 64-bit

I am running Visual Studio 2003 .NET Framework 1.1 application on Windows 2008 64-bit machine. There is only one problem - connection to Exchange Server. The same application is running fine on Windows 7 64-bit machine (not server). I tried to use the same Interop.MAPI.dll I used for Windows 7, but it doesn't work for Windows 2008.   Please help.  

Javascript Error in Internet Explorer but works fine in Firefox

Hi All,i was working on one of the project as it is working fine in Firefox but it is giving the javascript exception in internet explorer.Errror:  Error says  "s" is undefined in the s.currencyCode="USD" line but "s" is defined in the external javascript file  s_code.jsCan anyone suggest the solution for this issue:Please find my code where the error is displayed <script type="text/javascript" language="JavaScript" >var s_account="mnsdev"</script><script type="text/javascript" language="JavaScript" src="http://media.world.com/ads/usen/rpt/Omniture/s_code.js"></script><script type="text/javascript" language="JavaScript" >s.currencyCode="USD"s.charSet="ISO-8859-1"s.SEMct = s.getQueryParam('s_kwcid');s.SEMct = s.getValOnce(s.SEMct,'SEM_ct',0);s.clickPast(s.SEMct,'event9','event10');s.SEMvar=s.getQueryParam('s_kwcid');s.SEMdate=new Date;s.SEMdate.setTime(s.SEMdate.getTime()+60*86400000)if(s.SEMvar){s.c_w('SEM_ck','1',s.SEMdate)}s.SEMchk=s.c_r('SEM_ck');if(s.SEMchk&&s.events)s.SEMok='ok';if(s.SEMvar||s.SEMok) s.t()

ODBC connection to SQL Server 2005 Standard (on windows xp) with Windows authentication does NOT wor

I reviewed lots of postings, still could not find an answer. If I choose Windows authentication: - with TCP/IP and "Dynamically determine port" checked, I get the following error "The user is not associated with a trusted SQL Server connection; - with Named Pipes, Server Name & Pipe Name as "VSAXAONG", I get two errors, one after the other on the same pop-up:       Connection failed  SQL State 01000  SQL Server Error 1385 [Microsoft] [ODBC SQL Server Driver] [Named Pipes] ConnectionOpen (Connect()).       Connection failed  SQL State 08001 SQL Server Error 17 [Microsoft] [ODBC SQL Server Driver] [Named Pipes] SQL Server does not exist or access denied. If I choose SQL Server authentication and fill in the password - the ODBC connection works fine. I have to say that I created two different logins on the server, one for Windows authentication, and one for SQL Server authentication - both for the same Windows user name. I would appreciate any help I can get on this.  Thank you all in advance.

MDX works fine in SSMS but not in query designer

Hi all,   I am trying to include this query in my query designer in SSRS. The query below is as follows:WITH MEMBER [Time].[Fiscal Month].[All].[ Subtotal] AS ' AGGREGATE( EXISTING { [Time].[Fiscal Month].[All].CHILDREN }) ', SOLVE_ORDER = 1000  SELECT NON EMPTY { { { { [Time].[Fiscal Month].[All].CHILDREN }, { [Time].[Fiscal Month].[All].[ Subtotal] } } * { { [Measures].[SKU Distinct Count] } } } } ON COLUMNS , NON EMPTY { [Sales Force].[Retailer Code].[All].CHILDREN } ON ROWS  FROM [Sales]CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL The error i am getting isThe query cannot be prepared: The query must have at least one axis. The first axis of the query should not have multiple hierarchies, nor should it reference any dimension other than the Measures dimension..Please let me know where am i going wrong.Thanks and regards,ram

.aspx page when browsed with chrome browser works fine but with IE8 it displays "Internet explorer c

HiI have VS 2008 installed and have  IE8 browser as well as google chrome browser.However wheneever i try to run a .aspx page in solution explorer of VS with the browse with.. options,the page runs fine with chrome browser but not with IE8.The IE browser shows the error "Ineternet explorer cannot display the page".I have set the IE as the default browser in the browse with ... option of the VS 2008.Please suggest.

Why sum function work fine in infopath and not in web browser

Hi,   I used the sum function in infopath, it work fine in infopath client, but the same open in web browser it not working correctly, it show the double the value. why it happen?

Windows explorer view doesn't work on Windows 7

We are running Office SharePoint 2007 with SP2 on windows 2003 server. All windows 7 with IE 8 gets this message: " Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it". when click Windows Explorer in View. All Vista and XP work fine. I have tried these: 1. Added the SharePoint site on a Trusted Site. 2. Web Client is set to Automatically start, and that it is started. 3. We have Office 2003 installed on all computers. 4. We also tried to enable Comtability View. Is there a fix?Bob Lin, MS-MVP Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Setup Windows, Network, VPN & Remote Access on http://www.howtonetworking.com

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

how to change the web application Database connection form Windows authentication to SQL Server acco

Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.
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