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

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

Windows 7 - Alternative to DisableDHCPMediaSense flag to achieve the IP of NIC without cable connect

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :.NET Framework


first of all I hope this is the right forum for my question.

On Windows 7 I use the WMI object in order to set/achieve the IPv4 address of 2 NICs and generally 1 of them isn't connected to a network (the cable is unplugged).

During the iteration of WMI Win32_NetworkAdapterConfiguration objects the setup of the NIC without cable failed. On windows XP I had the same problem but using the DisableDHCPMediaSense flag solves the problem.

In the last days I search on the internet for some information but I don't found anything of usefull for my purpose.

How can have the IP configuration of an unplugged network card through WMI class?

Thank you.


View Complete Post

More Related Resource Links

WCF Client (netTcpBinding) does not connect to remote DNS on Vista and Windows 7

Hi, WCF Client (netTcpBinding) does not connect to remote DNS on Vista and Windows 7. With other OS like XP and Windows 2003, client connects to remote DNS properly. I got the following exception. Same client works in Vista and Windows 7 if service is available in local network. Following are the exceptions: <Exception> <ExceptionType>System.ServiceModel.EndpointNotFoundException, System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType> <Message>No DNS entries exist for host icelive.theice.com.</Message> <StackTrace> at System.ServiceModel.Channels.DnsCache.Resolve(String hostName) at System.ServiceModel.Channels.SocketConnectionInitiator.GetIPAddresses(Uri uri) at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout) at System.ServiceModel.Channels.TracingConnectionInitiator.Connect(Uri uri, TimeSpan timeout) at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.Comm

Windows 7 machines cannot connect

I have a problem with our Windows 7 systems. When users login they run a simple application that connects to a database (using a SQLOLEDB connection string) and writes a couple of entries. This works fine for all users on our XP machines. The App was written in VB6 and its essential we get it working or our Windows 7 deployment simply cannot go ahead. Problem is, on the Windows 7 machines all users get the generic 'SQL Server does not exist or access denied' message when this application is run. It will only run successfully as an admin user. I've tried everything I can think of, including disabling the firewall completely The users can connect to the same database using a UDL file so I know the connection details and connectivity are correct. For info it uses the Active Data Access Objects 2.5 Library and the sql connection string uses the 'Provider=SQLOLEDB' parameter. I've also tried update SQL Server Express 2005 to SP3 and it makes no difference. I then upgraded to SQL Server Express 2008 and still no difference. I installed the SQL management tools onto the machine and a non-admin user can sucessfully connect and browse the database using SQL Server credentials. So its not a driver or connectivity issue - but what else can I check to see why users get this error every time the app is run?

Cannot Connect to SQL server with SQL 2008R2 enterprise On windows server 2008R2

I have 2 identical brand new servers Running Windows Server 2008 R2 not on a domain but simple LAN. I Installed a default instance of SQL server 2008 R2 enterprise on each one with all the default settings. No Problems during the Installaion. I Added the Windows Administrators Group and Users group to the SQL admins role during the SQL Server Installation. Remote connections are enabled on each server. I restored the same database from a copy on each Installation. Configured the user accounts on each maching and made them sysadmins and granted permissions where they were needed. Now from server A when i try to establish a connection to Server B from SQl server Management Studio I get An error stating that the server was not found or accesible. keep in mind i can \\server B\c$ and vice versa, named pipes are enabled. I have never had this problem before in my life. And it's happening on both servers. I really need each installation of SQL to be able to see the other remote installation as i have to create a mirror. -Chris

SOS: Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But networ

Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But network connection is successful.   But SQL Server Logins contain   BUILTIN \ Administrators, and                                                    BUILTIN \  Administrators contain DOMAIN \ Domain Admins, and                                                    DOMAIN \ Domain Admins contain DOMAIN \ myname.   Creating SQL Server Login with DOMAIN \ myname entail successful local connection.   Removing SQL Server Login with DOMAIN \ myname and creating SQL Server Login with DOMAIN \ Domain Admins do NOT entail successful connection. Cannot connect! System:   Windows Server 2008. Error 18456

Cannot connect to SQL Server 2005 locally by Windows Authentication, but network connection is succe

Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But network connection is successful.   But SQL Server Logins contain   BUILTIN \ Administrators, and                                                    BUILTIN \  Administrators contain DOMAIN \ Domain Admins, and                                                    DOMAIN \ Domain Admins contain DOMAIN \ myname.   Creating SQL Server Login with DOMAIN \ myname entail successful local connection.   Removing SQL Server Login with DOMAIN \ myname and creating SQL Server Login with DOMAIN \ Domain Admins do NOT entail successful connection. Cannot connect!                                     &

Cannot connect to a configuration database after renaming Windows 7 computer


I have just recently installed a standalone instance of SharePoint 2010 on Windows 7 64-bit.  Everything was working fine, however, as part of joining my computer to the domain, my computer was renamed.  Now that the computer has been renamed, I am no longer able to connect to my locally installed SharePoint instance.  I receive an error message stating "Cannot connect to the configuration database."

I found this article on renaming a server for SharePoint Foundation: http://technet.microsoft.com/en-us/library/cc288510.aspx.  However, it seems like the article is assuming that the rename operation occurred while SharePoint was still running.  However, I am running SharePoint Portal Server 2010 and now that I cannot connect to the configuration database, I cannot make any alterations to the SharePoint instance at all.

In addition, my instance of SQL Server as well as the standalone SharePoint instance was installed prior to the computer rename.  What are the steps that are required to address this situation?


cannot connect to sharepoint server intranet site through VPN with windows vista home premium 64bit

Hi, a company i work for has an intranet site using sharepoint 2008. i can connect to the intranet remotely through their vpn however i am not able to view the instranet site or ping the server it is on...

does anyone have any ideas on whether this might be a vista issue or ????


Achieve Dwm color blurs on custom blurred windows


I've made a picture to describe my question best, as words really could not do it properly this time. The question and notes are included in the picture. http://localhostr.com/files/c7c2fe/Colorization.png

Transcript of notes:

Color Averages:

  • Blur: #FEC1C1
  • Unfocused: #FEC1C1
  • Focused: #DE6868
  • Taskbar: #DC6161

Question: How can I achieve the focused/taskbar color blends on a blur window.


  • The blur window is created with DwmEnableBlurBehindWindow

  • The glass windows are created with DwmExtendFrameIntoClientArea

  • No extra color handling has been done (i.e. rectangles/backgrounds)

  • Average colors calculated by a maximal gaussian blur on the GIMP.

  • Colorization information is obtained with DwmGetColorizationParameters

How to connect to a WCF intalled as a windows service with user name and password


I have installed my WCF service using

        <endpoint address="service" binding="wsDualHttpBinding" contract="aa.IABC" name="HttpBinding"/>

And I intall this service as a Windows service..

When installing the service I am giving

                serviceProcessInstaller1.Account = ServiceAccount.User;
                serviceProcessInstaller1.Username = userName;
                serviceProcessInstaller1.Password = password;   

I am trying to connect to this service using my client but cannot open the channel .


          <binding name="HttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"

Windows 7/Server 2008 R2 + Office 2010 cannot connect to SharePoint 2010


I have a Windows 7 x64 machine, with Office 2010 x86 installed.  I also have (2) Server 2008 and (2) 2008 R2 machines with Office 2010 x86 installed on them. On all of these machines I can not connect to SharePoint 2010 using Office.  The following occurs:

  • From the browser, browse to a doc lib. 
  • Click on an Office document, select "Edit in Microsoft ..."
  • An "Open Document" dialogue box appears, indicating that "Some files can harm your computer. If the file information below looks suspicious, or you do not fully trust the source, do not open the file.  File Name: Whatever.docx  From: SPServer2010.  (This is the first clue that something is not working properly.  I don't think this would appear otherwise)
  • Click OK.
  • The document opens, but with a [Read-Only] in the title bar. 
  • If I click save, it tries to save to a default location on my desktop computer.

Another example of the problem:

  • Open an Office 2010 application. 
  • Click File>Open
  • In the Open dialogue box, type in the URL of a document lib on the server. 
  • The error message: You can't open this location using this program. Please try a different location.

Final example of the problem:

  • Click Upload Multiple

VisualStudio 2008 64bit in windows 2008 r2 64 bit oracle does not connect to databas



I am currently using visualstudio 2008 with 3.5 framework sp1 release.

We want to migrate our applications to the new server everything as a 64 bit. which is having the following configuration 

windows 2008 server  R2 64 bit with Oracle as backend.

We donot have any 32 bit oracle client tools installed.I am able to connect to the database by using a console/windows/class library applications

When I try to simply connect to the database(open and close the connection) using either a website or a webapplication.I am getting the following different types of exceptions

Oracle client and networking components were not found. These components
are supplied by Oracle Corporation and are part of the Oracle version
7.3.3 or later client software installation.

Provider is unable to function until these components are installed.
Attempt to load Oracle client libraries threw BadImageFormatException.
This problem will occur when running in 64 bit mode with the 32 bit
Oracle client components installed.

Cannot connect to local server with windows authentication


When I try to connect to my local server using windows authentication I get the following error:

Login failed for user 'Will-PC\Will'. (Microsoft SQL Server, Error: 18456)


It happens if I try to give the server name as WILL-PC, (local), localhost, or "."

I am on Windows 7, and I am using SQL Server 2005 Standard edition, the and SQL Server service is running.  I can't get into the server in any way to see what users are available.  Please help!

How To connect remote server in windows form application


Hi All

i have implementing one Windows application in that i need to get the Forex market quotes values form perticulat server how can i implement this i have some Php Code but i need to in C# application.

This is my Php code to receive the quotes form server;

define('T_HOST','');  // MetaTrader Server Address  

define('T_PORT',443);                   // MetaTrader Server Port
define('T_TIMEOUT',1);                  // MetaTrader Server Connection Timeout, in sec


define('T_CACHEDIR','cache/');         // cache files directory
define('T_CACHETIME',1);               // cache expiration time, in sec

define('T_CLEAR_DELNUMBER',1);        // limit of deleted files, after which process of cache clearing should be stopped

$MQ_CLEAR_STARTTIME = 0; // time
$MQ_CLEAR_NUMBER = 0;    // deleted files counter

// query quotes and parse result
                          // $re=MQ_Query($q);
$qRes = MQ_Query($q);
function MQ_Query($query,$cacheDir=T_CACHEDIR,$cacheTime=T_CACHETIME,$cacheDirPrefix='')

   $ret = 

Net.TCP Endpoint; Windows Authentication security; client can connect to a server at localhost but n


Hey all, so here's what going on:

I have a WCF Service that I have setup as a Windows Service.  Everything works perfectly when I attempt to use the system with all of the components (i.e. server and clients) on the same machine.  However, when I try to connect my client from a different system, I get an error that is trying to tell me that the server rejected the client's credentials.

I need the client to the able to connect from a different machine.  I want to implement a SQL Role Provider kind of credentialing in the future, but for now, I just need it to work.

What I have tried
I have looked around online and read a few other posts as well some things in the MSDN KB and I have either not found the answer, or not understood it.

  • I have tried setting the <security mode="Transport"> to "None" with the hope that that would disable the accreditation entirely.  All it did was result in a different error saying that there was an error that might have been caused by an invalid message.  I have also tried a few other configurations with this element in the app.config file; to no success.
  • I have read some things about Impersonation, but I am not quite sure I understand how to implement it

windows 7 can't connect to SQL Server 2005


This is quite the odd problem, or at least that's how it seems.   I have a brand new installation of Windows 7 x64 as my dev machine.  I am having issues with connecting to instances of SQL2005 SP2.   We'll call them LOCAL_NETWORK_SQL and VPN_SQL, and they are both named instances.

From my Win7 machine, I can connect to LOCAL_NETWORK_SQL using Management Studio.  I can NOT connect to it using any SqlConnection through .NET.  This fails with..

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified"

I can NOT connect to VPN_SQL using either Management Studio OR a .NET SqlConnection; it fails with the same error (above) in both cases


I CAN connect to other SQL server instances ( SQL2005 SP3) that are on the same VPN network/domain as VPN_SQL using either Management Studio OR .NET SqlConnection.

I CAN connect to a named instance that is hosted locally on my dev machine (SQL2008 Express)

This seems a little bit like the issue described here http://social.msdn.

cannot connect my iburst from windows xp home edition


good day,

i have a problem with my laptop and i do not know if it I burst or windows.The things is i can not use internet anymore , i tried to connect via my 

Sql Server connection issue : I can connect from a web app, but not from a windows app.


I have two applications, a win form and a web app. I am using  sql server on a local network. I can open a connection to the sql server from the web app, but the win form app always fails when i try to open a connection. I get a TCP provider error of all sorts. I am using the same connection string for both apps.

Any Idea,



Additional Info:

Visual Studio 2010, Sql Server 2005,


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