• Home
  • About
  • BestBloggingIdeas
  • DotNetLearningSource
  • FORUM
  • Joblinks
  • Latest News
  • Policy
  • POSTS
  • SimplySqlServer.Com && SimplyAspDotNet.Com
  • Sitemap

Join Ours Forum

Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

RSS Feed

Top 10 Articles,


1.Hosting/Install Wcf Services in a Windows Service Asp.Net C#

2.Connecting Silverlight to Wcf Asp.Net C#

3.Silverlight Data Grid Data Binding WCF Asp.Net C#

4.Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

5.Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

6.Silverlight Datagrid Select Update Delete Insert Asp.Net C#

7.Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

8.Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

9.Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

10.Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#


  • Bounty Huge Roll [Amazon Frustration-Free Packaging]
  • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
  • The Basic Overview of Windows Mobile Development Asp.Net C#
  • Overview of Sql server extended properties Asp.Net C#
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#
  • Adobe Dreamweaver Templates Accelerate Web Development
  • Top Tips for Web Design Projects
  • How to Achieve a Good Web Design Structure
  • To Use Or Not To Use Website Templates
  • Five Tips to a Successful Website
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#

    Posted by james on June 15, 2011 0 comments

    Being application developers that use Visual Studio, we need a way to access and work with these extended database properties from our applications. In order to demonstrate how we can access these extended properties, the following code examples use a class library project that hosts a test fixture.

    If you need to engage in this sort of work, you will likely want to make your application configurable with the current database property values. For example, if your application is configured to work against version 2.0 and the database is stamped as version 1.0, you will likely want to throw an exception. The last thing you will want to do is hard code the database version into your application. Fortunately, we have the System.Configuration class that can be used to configure your application. In this case, the application is a simple test fixture that contains a few tests. In order to make the application configurable, we need the following:

    app.config file with necessary configuration section
    configuration class
    The app.config file handles two things:

    Defines the configuration section (in this case, the section is named SQLExtendedProperties)
    Creates the relationship between the configuration section and the configuration class
    If you are new to system configurations, check out ASP MVC Team Member Phil Haack’s blog post on the topic: http://haacked.com/archive/2007/03/12/custom-configuration-sections-in-3-easy-steps.aspx.

    In this example, the application is configured to work with version 1.0.0. Also note that in the configuration, OLE-DB connection string information is associated with the version property. If you are thinking that we could have different configuration sections for test, debug and production, you are 100% correct and on the right track!

    The SQLExtendedProperties class provides a structured class around the SQLExtendedProperties configuration section. List1 illustrates four helper methods that are used to add, update, query and remove an extended property.

    The code outlined in List 1 is nothing more than wrapping around ADO.NET and our application configuration. The application configuration is used to drive which database server is used. In addition, the application configuration specifies which database version is appropriate to interact with our application. List2 puts it all together in a series of unit and integration tests that verifies the SQL Server Extended Property Functionality.

    List 1:

    private static void ExtendedPropertTest(SqlConnection local_conn,
     string PropertyName)
     {
    using 
    (var _command = 
      new SqlCommand("sys.sp_ExtendedPropertTest",local_conn))
     {
     _command.CommandType = CommandType.StoredProcedure;
     SqlCommandBuilder.DeriveParameters(_command);
     _command.Parameters["@name"].Value = PropertyName;
     _command.ExecuteNonQuery();
    }
    }
     
     
    private static string GetExtendedPropertyValue(SqlConnection
     local_conn, string PropertyName)
    {
     string _version;
    using 
    (var _command =
     new SqlCommand(String.Format("select value from
          sys.extended_properties where name = '{0}'", PropertyName),
       _  connection))
    {
     var _reader = _command.ExecuteReader();
     _reader.Read();
     _version = _reader.GetString(0);
     _reader.Close();
     return _version;
    }
    }
     
     
    private static void AddExtendedProperty(SqlConnection local_conn,
     string PropertyName)
    {
    var _command = new SqlCommand("sys.sp_addextendedproperty",
     local_conn);
     _command.CommandType = CommandType.StoredProcedure;
     
    SqlCommandBuilder.DeriveParameters(_command);
     
     _command.Parameters["@name"].Value = PropertyName;
     _command.Parameters["@value"].Value =
     SQLExtendedProperties.LoadBySectionName().version;
     
     _command.ExecuteNonQuery();
     
    }
     
     
    private static void UpdateExtendedProperty(SqlConnection
     connection, string PropertyName, string PropertyValue)
     {
     using (var _command = new
     SqlCommand("sys.sp_updateextendedproperty", local_conn))
    {
     _command.CommandType = CommandType.StoredProcedure;
     SqlCommandBuilder.DeriveParameters(_command);
     _command.Parameters["@name"].Value = PropertyName;
     _command.Parameters["@value"].Value = PropertyValue;
     _command.ExecuteNonQuery();
    }
     
    } 
     
    private static SqlConnection GetConnection()
     {
    var local_conn = new
    SqlConnection(SQLExtendedProperties.LoadBySectionName().connection);
     local_conn.Open();
     return local_conn;
    }
     
    List 2:
     
    [Test]
    public void can_retrieve_version_value_from_config_file()
    {
      var _version = SQLExtendedProperties.LoadBySectionName().version;
      Assert.AreEqual("1.0.0", _version);
    }
     
     [Test]
    public void can_open_and_close_dblocal_conn()
    {
      var local_conn = GetConnection();
      Assert.AreEqual(ConnectionState.Open, local_conn.State);
     
      local_conn.Close();
      Assert.AreEqual(ConnectionState.Closed, local_conn.State);
     }
     
     [Test]
    public void can_create_extended_property()
    {
      var local_conn = GetConnection();
      AddExtendedProperty(local_conn, "Version");
     
      Assert.AreEqual(SQLExtendedProperties.LoadBySectionName().version,
       GetExtendedPropertyValue(local_conn,"Version"));
     
      ExtendedPropertTest(local_conn,"Version");
     
      local_conn.Close();
     
    }
     
     [Test]
    public void can_update_extended_property()
    {
     var local_conn = GetConnection();
     
     AddExtendedProperty(local_conn, "Version");
     
     UpdateExtendedProperty(local_conn, "Version","2.0.0");
     
     Assert.AreEqual("2.0.0", GetExtendedPropertyValue(local_conn, 
      "Version"));
     
    ExtendedPropertTest(local_conn, "Version");
     
    local_conn.Close();
     
    }

    Hope this helps

    Adobe Dreamweaver Templates Accelerate Web Development

    Posted by james on May 21, 2011 0 comments

     

     

    Adobe Dreamweaver templates are one of the most powerful development aids that the program contains. Basically, a template is a master design which can be copied repeatedly to generate an limitless number of web pages each one containing the same shared elements. Obviously, each time the template generates a new page, the page can be customised and the requisite elements added to it to make it unique. This is achieved by a technique of locked page regions and editable regions.

    When the template is applied to a page, locked regions cannot be modified. (You have to return to the template to modify them.) Only the areas of the page designated as editable regions can have content added to them.

     

    To create editable regions on the template, you simply position the cursor in the required area of your layout and choose Insert – Template Objects – Editable Region. Enter a name for the region and click OK. One frequent problem experienced by new users of Dreamweaver is the accidental placement of and editable region inside a heading or paragraph tag. This means that when the template is applied to a page, only text can be placed in the editable region. To remedy this problem, return to the template, click in the editable region and examine the Tag Selector on the left of the Status bar. Having located the offending tag (usually h1, h2, p, etc.), right-click on it and choose Remove Tag from the context menu.

     

    To associate an existing page with a template, open the page and choose Modify – Templates – Apply Template to Page. Next, double-click on the name of the template to be applied. Strangely enough, there is no Dreamweaver command that enables you to apply a template to several pages at once. However, here are two suggestions for applying a template to multiple pages reasonably quickly.

     

    Begin by selecting multiple pages in the Files panel using the classic techniques of Shift-click or Control-click (Command-click on a Mac). Then, you can right-click one of the selected files and choose Open from the context menu to open all of them. Next, activate the Assets panel (Window – Assets) and click on the Templates button (the second icon from the bottom). Finally, drag the icon of the required template onto each of the open pages. To speed up the process, use Control-Tab to switch from page to page.

     

    To create a brand new page based on a template, choose New from the File menu and, when the New Document window appears, select the Page From Template option, click on the site that contains the template (It should already be highlighted.), then choose the template. To get the most benefit from a template, before clicking the Create button, make sure that the option “Update Page When Template Changes” is activated.

     

    « Previous page | Next page »

    Enter your email address:

    Delivered by FeedBurner

    <
    • Random Posts

      • Dale’s Steak Seasoning, 16-Ounce Bottles (Pack of 6)
      • Converting Phone Number into Alphabetical to Number
      • Creating Developing Cascading DropDownlist Using Ajax/JQuery/JavaScript/ASP.NET
      • Implementing a Directory Structure as a TreeView creating directory/windows explorer like treeview asp.net c#
      • Exporting Copying Sending Sql Table data into Excel Using OpenRowSet/Sql Server
    • Search by Tags!

      Application AspNet Basic between Black Bluetooth Build Business Collection Consultants Design Development Downloading effective Excel Experts Generics Implement Installing Interview Logic Management Microsoft Minutes Object Outlook Professional Programmer Programming Project Projects Questions Ready Select Server Services Silverlight Source Strings Studio Through using Visual Website Wordpress
    • Archives

      • August 2011
      • June 2011
      • May 2011
      • April 2011
      • March 2011
      • February 2011
      • December 2010
      • November 2010
      • October 2010
      • September 2010
      • August 2010
      • July 2010
      • June 2010
      • May 2010
      • April 2010
      • March 2010
      • February 2010
      • January 2010
      • December 2009
      • November 2009
      • October 2009
      • September 2009

    Copyright © 2012 NetProgrammingHelp.com

    Δ Top