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

Post New Web Links

SQL 2008 R2 Dynamic Ports and Static Ports

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :Sql Server

We have a single application (Interaction) that needs the port number specified in the application itself in order to 'talk' to its SQL database. The SQL environment consists of a two node cluster with two named instances. Each of the instances are divided equally between the nodes. We are obviously using dynamic ports on both of our names instances. I gave the application owner the port that the instance the database is currently running on. He hasn't gotten back to me yet, however, I suspect that when he specifies that port in the application it will connect to the database just fine. If it does, I need to come up with a plan for this one application.

Is there a way to use both dynamic ports with a static port specified? In the TCP/IP properties under the instance name, dynamic ports are used because the 'TCP Dynamic Ports' is set to '0'. Can I set it to something like '0,5100'? That way it'll still use dynamic ports with a specific port to always listen on? It seems like a stretch, but I'd rather not change my whole environment due to one silly application.

Another solution is to maybe create another instance for this one application and set the port statically? That's also very silly in my opinion to have a dedicated instance with only one database to set a static port. If anyone has any other creative ideas, besides just using the

View Complete Post

More Related Resource Links

JDBC Connection using Dynamic Ports


I have a sql cluster running 3 instances.One of the user is trying to connect to these instances using JDBC connectivity.We have configured to use Dynamic ports so the url with the default port is not working for us and I cannot change the port.Can you please plese let me know the URL for this.Also on the Surface Area Configuration Manager I sec Client Protocols ,How is this different from the Protocols for each instance.




Windows Sockets 2.0: Write Scalable Winsock Apps Using Completion Ports


Writing a network-aware application isn't difficult, but writing one that is scalable can be challenging. Overlapped I/O using completion ports provides true scalability on Windows NT and Windows 2000. Completion ports and Windows Sockets 2.0 can be used to design applications that will scale to thousands of connections. The article begins with a discussion of the implementation of a scalable server, discusses handling low-resource, high-demand conditions, and addresses the most common problems with scalability.

Anthony Jones and Amol Deshpande

MSDN Magazine October 2000

Comport communication using System.IO.Ports

I am using System.IO.Ports to communicate the with the printer(Com RS 232). What i want to know is how can i determine weather the Printer is Power on or not.. (i mean Printer is power cable is plugged in and Power on) and also When to use HandShake.XON/XOFF 

Scan Ports

I want to scan my local ports and find open ones. how can I do this in VB.Net?? I want to find open ports form my Socket Listener. I have this code - but it is too slow Public Shared Sub Main() Dim intPortStart As Integer = 100 Dim intPortEnd As Integer = 500 Dim lngLoop As Long For lngLoop = intPortStart To intPortEnd Dim myTcpClient As New TcpClient() Try myTcpClient.Connect("", lngLoop) Console.WriteLine("Port " + lngLoop.ToString() + "started") myTcpClient.Close() Catch ex As SocketException Console.WriteLine("Port " + lngLoop.ToString() + " Closed" + ex.Message) End Try Next End Sub

Menu with Static and Dynamic Menu Items

I need to populate a menu with static and dynamic (at runtime) menu items.  I know this issue has been posted before, but I haven't seen anything with a date newer than 2009. This is what I want to do: <Menu> <Menu.ItemsSource>                     <CompositeCollection>                      <MenuItem Header="Menu Item 1" /> <MenuItem Header="Menu Item 2" /> <MenuItem Header="Menu Item 3" />                         <CollectionContainer Collection="{Binding MyMenuItems}" />                     </CompositeCollection> </Menu.ItemsSource> </Menu>   The posts every where say the issue is that CompositeCollection is not freezable.  Regardless of that arguement, has anyone come up with a good solution.  I don't want to create it all in code behind because it is a decent size menu with separators, etc.  This seems like something that should have been fixed or have a decent work round by now.   Thanks. 

Static and Dynamic Resources with Brush and Resource Dictionary

Hi, We're using a huge resource dicionary with all the styles and templates for our controls. Some of these are the images that we use for some buttons and icons in the application. As far as I know, Static and Dynamic resources have nothing to do with the ResourceDictionary and The Brush, i could use any of them, if i need the resource to load only when needed i could use dynamic and if i want it to load on initialization time i should use Static. But everytime i try to use a static resource to define a Fill of a rectangle my application crashes on initialization time (when it exectues the InitializeComponents). The resource i'm using is a DrawingBrush that is declared on my resource dictionary and the only way i could make it works is defining it as DynamicResource. What is the limitation? Its realy impossible to define a static resource on a fill property, and if its realy impossible, why?

Pinvoke : GetCommConfig not working for parallel ports like lpt1



Through PInvoke from VB.net, I am using GetCommConfig and GetDefaultCommConfig to find info on ports present on the computer. However these functions are succeeding only for Serial Ports like COM1 etc and failing for Parallel Ports like LPT1.

Is This by design? The documentation suggests this should succeed for both serial and parallel ports as well as others.


Mathew Kochekkan

Percent of Total Calculation with Mixed Static and Dynamic Groups


Ok, here's one I'm really struggling with.  I have a report that has two dynamic row groups and three dynamic column groups that are nested beneath static column groups.  It looks similar to this:

                                                  Market Share                  Discharges                           LOS

                                                Column Group1               Column Group2               Column Group3

Row Group1  Row Group2       &

Enumerating used and available network ports on remote server


I am working on a setting up a web app, using C# and .Net, to setup/manage an internally deployed product. Part of this requires adding new instances and configuring them which means knowing if a port is available on the remote server.

I've done a bit of searching and can't seem to find a way to do this on a remote system. I could find ways to do it locally which if that is the only way then I may end up doing a localized service to have the web app talk to instead but I wanted to check if there was a way to get this info remotely.




Single WCF Service with multiple ports


Hi All,

            I have  created a WCF service that receive and  give the update to subscribing clients. Now, we host that service on single server only ( this service is hosted as a window service) , So i want when WCF receive any update from a specific client   and  it will give the update  to  only that  specific  client .  I don't want to create separate service for every client . Can i achieve this in single WCF Config file by mention different Ports for each client?  I am using net tcp approach that is best suited for my environment.  I have used BaseAddressPrefix and also mention the URI directly in the endpoints but it  give update to all clients subscribe on different ports. Any solution?  I only wants  this in that way if possible "specific port for that specific client".

Thanks in advance

Static column after aggreate column in matrix reporting service 2008


Dear sir/madam,

I would like to creating cross tab with static column after aggregate column. My report showed as below:


Name of employee

Performance Rating

Total Rating (Average of Performance rating)

Previous Salary






A. Managerial Employee








B. Non-Managerial Employee








Performance Rating is cross tab column

Total Rating is Aggregate column

Previous Average,Previous,Increment is static column

I look forward to hearing from you.

Thanks in advance,

SSRS 2008 dynamic change to report parameter properties


I'm running SSRS 2008, and I'm wondering if it is possible to change a report parameter property based on user input in another report parameter.  What I need to do is to make report parameter #2 a required parameter if a specific value is selected in parameter #1.  Parameter #2 should be optional under all other scenario.

Thanks in advance.

SSIS 2008: Problem reading dynamic file during execution



I have a SSIS 2008 project that reads a bunch of files from a file (always the same file) from Machine A.
My package is running on Machine B and this is where the information is being imported to, my Reporting DB (sql 2008) is also located in Machine B. 
I have a dynamic log file that stores the execution errors every time the package is executed and its name is made up of the timestamp of when package starts executing. The "DelayValidation" option for this connection is set to "TRUE". When i execute my Package from Visual Studio 2008, it runs without a problem.
The problem is when i deploy my package into SQL Server 2008 and try running it through DTEXEC. I always get the following error:


Error: 2010-11-03 14:57:29.06
   Code: 0xC001401E
   Source: MyImportPackage Connection manager "ImportLog"
   Description: The file name "\\ip-address\d$\Logs\ImportManager\20101103_145726.txt" specified in the connection was not valid.

Centering Images in dynamic rows - SSRS 2008 R2



I'm using SSRS 2008 R2. I have a tablix in which one of the column has textbox grows dynamically based on the dynamic content and the other column is an image control. In the image control, i have a very small image and I want this to be centered in that cell. It always renders at the top left corner. Since the tablix row grows dynamically, I couldn't set the Top padding.

Any help would be appreciated.






asynchronous code for checking ports


Hi there,

I have some code which connects to a port quickly and if it can connect then it turns the line in the gridview green, if it cant and times out then it turns the line red. This is great, the problem i have is that the page takes a long time to load (as it has to check each port first) and then if i want to check again if the port is up / down i have to manually refresh it which is not what im after.

  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        for (int i = 0; i < GridView1.Rows.Count; i++)
            string strHost = "";
            int StartPort = 0;
            GridViewRow Row = GridView1.Rows[i];

            strHost = Row.Cells[3].Text;
            StartPort = Convert.ToInt32(Row.Cells[2].Text);

            int CurrPort = StartPort;
                TcpClient TcpScan = new TcpClient();

                    TcpScan.Connect(strHost, CurrPort);
                    e.Row.BackColor = Color.Green;

                    e.Row.BackColor = Color.Red;

        }//end of loop    


The code is in a loop and cycles through the various ports in the DB, what i want to know is how i can writ

Setting static port for SSAS 2008 R2



In my experience I don't meet the requirement to set a static port for the Analysis Services. Working with the 2005 version, I think that it is possible set the static port from the properties of Analsysis Server in the Management Studio. How do I do this operation in SSAS 2008 R2, please? Does it exist any documentation about this subject?

Many thanks

AAM for other ports?



So, I have two Sharepoint web applications. Let call them Application1 and Application2.

Application1 is accessed via http://notMachineName1

Application2 is accessed via http://notMachineName2

Application 1 runs on port 80 and Application 2 runs (or should run) on port 84 and the URL's used are directed from the DNS.

Everything works as expected BUT the settings from web.config. Both applications get their settings from the same web.config, which in this case is a problem as the connectionstrings (amongst other things) are different. To clarify, these applications use other databases than the content db's for Sharepoint and that's where my problem is, fetching data from other db's not tightly coupled with Sharepoint. The settings that both applications pick up is from the web.config for the 80 port.


AAM mappings in CA

http://servername Default http://servername
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