Community Blogs

Browse by Tags

Related Posts

  • SQL Server Day

    Você quer aprender mais sobre o SQL Server 2008? Então reserve o sábado, dia 07/11/09 inteiro! A comunidade, com o apoio da Microsoft vai realizar um evento online com mais de 12 horas de duração ininterruptas! Com alguns dos melhores profissionais de SQL Server no Brasil compartilhando seus conhecimentos e tirando dúvidas sobre os mais diversos assuntos. Grade de palestras: 09:30 - 10:00 - Abertura do Evento 10:00 - 11:00 - Resource Monitor e Policy Management - Vitor Fava e Alexandre Lopes 11:00 - 12:00 - Entenda porque o Query Optimizer é mais esperto que você - Fabiano Amorim 12:00 - 13:00 - SQL Azure Database - Diego Nogare 13:00 - 14:00 - Novos Recursos de Desenvolvimento do SQL Server 2008 - Higor Fernandes 14:00 - 15:00 - Compressão...


  • How to Reseed a SQL Server Identity Column

    In SQL Server you can specify a column as an Identity column (ColumnName int IDENTITY(1,1) NOT NULL) to have SQL Server automatically set the value of this column upon insert by incrementing a seed value.  This works great but I have run into situations where I wanted to change what identity value is assigned during the next insert.  What had happened is that this table in question had the primary key column set as an Identity column.  There were only a couple thousand rows in the table but SQL Server was handing out identity values in the 10-million range.  In most cases this would not be a big deal, but for this table the identity value was actually used by customers so a eight digit number was not as easy to remember and...


  • Using Parameters with Dynamic SQL

    Some programming situations require you to use Dynamic SQL. Of course the problem with using Dynamic SQL is that this can lead to SQL Injection attacks. However, you can avoid these problems, by just changing how you submit Dynamic SQL to your back end database. To illustrate this, consider the sample table of users listed below. CREATE TABLE User ( Login char(16) not null primary key, Password varchar(20) not null ) go INSERT INTO User values('PSheriff', 'password') go INSERT INTO User values('Keng', 'password') go You can copy and paste the above SQL code into your database management system and create this table. After you have created this table, you might create a login screen and use some code like the following...


  • Open SQL Port for specific IP by ASP.NET Website

    We run a public SQL Server on Windows Server 2008 and had a lot of dictionary attacks in the past. To prevent that, do following 1) disable sa user 2) enable Windows Firewall, set a inbound rule ( here named sql) and lock the port 1433, then add the external IP’s ( scope tab) which needs access from extern   Now you are save. New problem is, what happens when you have dynamic IP address on client and need access by SQL Manager or Visual Studio Server Manager. Take really long time to solve that problem. My goal was to establish a website, where you click a button and your IP is in the firewall. 1) create a user account on server which have exactly the fitting rights for netsh and firewall. Group User should be enough 2) create in IIS7 a...


  • LINQ to XML Quick Brain Dump

    LINQ to XML is a simple toolset that allows developers to easily interact with XML, whether it be in file form of on the wire in string form. Write to an XML file There are a few methods within the System.Xml.Linq namespace which make this interaction a breeze. The four main ones are:- XDocument – Method which creates the XML document XDeclaration – Allows you to set the declaration at the top of the file. XElement – Creates a hierarchical element structure XAttribute – Creates any attributes related to an element. The following code shows a very simple way to generate an XML document for members of a club. 1: Member[] members = new [] { 2: new Member{Age = 33, FullName = "John Havers" , Title = "Mr" }, 3: new Member{Age...
    Posted Aug 25 2009, 04:10 PM by ASP.NET Weblogs
    Filed under: , , ,


  • Missing Microsoft.SqlServer.SmoEnum Dll

    I like this SSB (Sql Server Broker) Admin tool but every time I refer this to somebody they come back to me with the questions that some of the DLLs are missing and they can’t launch the application. You should be able to find all the missing Dlls on the server where there’s an installation of SQL Server 2005 Enterprise (I’m not sure about the other versions) at the following location. C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies Hope this helps someone....( read more ) Read More...


  • [Link List] Recent (and non recent) Articles on Various Topics

    p.msolistparagraph {margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:.5in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif"; } a:link {color:blue; text-decoration:underline; text-underline:single; } p.msonormal {margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif"; margin-left: 0in; margin-right: 0in; margin-top: 0in; } Allow me to quote here some emails I sent to the the Dot NET developers group in my company, Injazat, or, as we call ourselves, Ninjazat . I thought it’ll be useful to share some with you as well. ·          ASP.NET MVC - 20 Hours of FREE Video Tutorials ·         ...


  • What is a clustered index anyway?

    Recovered from DotNetJunkies blog -- Originally Posted: Saturday, February 17, 2007 Wanted to drop a quick post for two reasons: 1) To prove I have not died, been abducted by aliens, or been confined to a room with soft, cushy walls and a nerf PC for my own "protection". 2) To give a plug for someone I had an opportunity to work with this past week. Our shop was in need of some SQL Server performance tuning. Not having the expertise in house we called in an outside consultant. Not having had the best experiences with outside "experts" in the past, I was skeptical. However, Ray Rankins and his Gotham Consulting seem to be the real deal. Not living in the SQL world day in and day out, I tend to leave the "deeper thoughts"...


  • Schema compatiblity error in configuring SqlMembershipProvider

    I was working with one of my projects in which I had to use Membership/Role providers. I run the wizard using aspnet_regsql.exe to create the structure of SqlMembershipProvider. I added few roles and users using ASP.Net Configuration. Everything worked fine tested my application multiple times and it worked very well. Then I generated the script from my local database for SqlMembershipProvider since we can not run the utility aspnet_regsql.exe on our test server. Everything went well so far. All the tables, views, stored procedures, roles were created and permissions were granted. Then when I try to run my application from the test server it gave me following error. "The 'System.Web.Security.SqlMembershipProvider' requires a database...


  • Uploading an Excel file to SQL through an ASP.NET webform

    The method below describes how to upload a file to a webserver and then import the file into SQL using either LinqToSQL or SQL Bulk Copy. The sample code only shows how to import xls and xlsx files but it could easily be extended to support csv files too.  Sample code is attached at the bottom. We will be uploading data from an Excel file containing columns CompanyName and Phone and loading that into the Northwind Shippers table. We’ll start by uploading the file to the webserver. This is done with the help of the FileUpload web control. The FileUpload control has a SaveAs method which saves the contents of the file into the location that we specify. The file will be stored in a temp folder under App_Data since App_Data is not browsable...


Page 1 of 9 (90 items) 1 2 3 4 5 Next > ... Last »
Microsoft Communities