Wednesday, December 21, 2011
Just a Little Question
From what I can see, they certainly do!
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, December 20, 2011
Incrementing a Non Numeric Index in SQL Server
So I wrote a function based on this SQL.
select 'C' + isnull(cast(1+max( cast(SUBSTRING(Invoice_no,2,99) as int)) as varchar),'1000')Let's work from the inside out.
from Sales where Invoice_No like 'C%'
- Invoice_no is the column to increment. ('C1234')
- first we substring the first character off with SUBSTRING(Invoice_no,2,99) ('1234')
- we use cast to find the integer of it (1234)
- we use 1+max to aggregate (find the max value of this integer) and add one. (1235)
- we cast the result back to a varchar ('1235')
- then - if isnull gives us a nulll, we use the hard-coded value of '1000'
- we prepend the 'C' back on ('C1235')
Now we make this into a function so we can use it like "GetDate()" in the default value of the column.
ALTER FUNCTION [dbo].[NextSalesID] ()Now we have to add it as the default value for our column. This is accomplished by editing the table in SQL Server Management Studio, selecting the column, and...
RETURNS varchar(10)
AS
BEGIN
DECLARE @Answer varchar(10)
select @Answer= 'C' + isnull(cast(1+max( cast(SUBSTRING(Invoice_no,2,99) as int)) as varchar),'1000')
from Sales where Invoice_No like 'C%'
RETURN @Answer
END
Binding a scalar Function to a Column Default |
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, December 6, 2011
A Generic Error Logging Object
Enjoy.
If you want to log to a database, you must create the data table.
Next, add this object to your project (Project-Add New Item-C# Class)
Name the new object "log.cs"
Now, all you need to do to from your app is add a call to log. ...
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Sunday, November 27, 2011
Insecure Security
Your password must be at least 12 characters, and include capital and lowercase, numbers, and punctuation marks. It cannot be any of your last 10 passwords. Also, you must change it every 10 days.
- program our browsers to remember our passwords
- create a text document to keep all our passwords
- or, write them on a sticky note and paste them all over our desk.
Why? Clearly this can't be in the name of security, because you're forcing everyone to make records of their passwords. A password like grommet would be adequate for most web sites. It just doesn't make any sense to force people to use passwords like L9We&$KjU88. That is a GUARANTEED breach of security policy because the user is going to write it down somewhere.
Designers take heed. Let the users determine what passwords are secure enough. Other than banking and medical stuff, there is nothing requiring this strong a password.
...
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, November 22, 2011
Reinstalling the .NET Framework on a WebServer: No Picnic
Windows SBS 2003 used as a webserver.
Ok, I was getting the same Autoupdate from Windows Update everyday, so I posted a question about it, and was advised to reinstall the .NET Framework as something had become banjaxed.
I put this off, because installing the .NET Framework (3 versions of it) had initially taken me hours. But, being sick of the repeated updates, I finally scheduled maintenance time and went for it.
Here is the procedure that eventually worked for me to get from point A to point A (as it turns out) eating more than an entire day in the process.
Uninstall
The .NET Frameworks must be uninstalled in order, according to Microsoft, I had to guess that meant 4.0, 3.5, 2.0. This process was handled easily from the Add/Remove Programs window, even though there are numerous blog posts out there claiming that this does not work, and there is some program out there that does it better. Regardless, here is the sequence I used.
- Open C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and edit MACHINE.CONFIG. Capture the username and password, if any in the <processModel node.
- Open C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 and edit MACHINE.CONFIG. Capture the username and password, if any in the <processModel node.
- Open C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 and edit MACHINE.CONFIG. Capture the username and password, if any in the <processModel node.
- Stop IIS
- Uninstall 4.0
- Uninstall 3.5
- Uninstall 2.0
- Reboot
Download and Install
Make sure when you download the new versions, that you get the FULL .NET Framework, not the "client" ones.
NOTE THAT THIS PROCESS TAKES MANY HOURS (around 12) TO COMPLETE
- Install 2.0
- Install 3.5 --This is exceedingly slow
- Install 4.0 --less slow than 3.5, but still... bring a book.
- Reboot.
- Let Windows update install all it's patches.--this takes a couple hours, as the 'full installs' of the .NET Framework are not the latest, they need lots of patches.
Use this rereg.bat file to re-register all the .net frameworks
This may need to be adjusted as more frameworks come out.
This will mean you must re-enable the frameworks.
Open IIS manager, and look in Web Service Extensions.
Make sure to re-enable all the frameworks.
Now all your web sites are back, but they all give
Server Application Unavailable
...errors.
This is because you need to re-grant your aspnet worker processes access to the server, which is off by default. Last time this happened, you created an ASPNET user and granted him access to do his job, because some nutjob at Microsoft decided that not allowing the webserver to do anything would be more secure.
Navigate to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 and edit MACHINE.CONFIG.
Around line 633 there is a line that looks like this: make sure the user is valid.
userName="[user]" - Windows user to run the process as.
Special users: "SYSTEM": run as localsystem (high privilege
admin) account.
"machine": run as low privilege user account named "ASPNET".
Other users: If domain is not specified, current machine name is assumed to be the domain name.
Next, Navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 and edit MACHINE.CONFIG.
Around line 135 there should be a line that starts with <processModel . Make it say this...
<processModel userName="ASPUSER" password="whatever" />
... of course use the password you used to create the account.
Then go to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319, and do the same, the <processmodel line is around line 250.
Yes, I left out 3.0 and 3.5, as they do not have a machine.config file.
Use IISRESET or just reboot the server to complete the task.
...
In my case, I still get the repeated update requests (hence the 'point A to point A' comment), but since I figured there are legitimate reasons to reinstall the framework and others might get caught in this horrible trap. Hopefully this will save you some aneurisms.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Saturday, November 19, 2011
Using Return Values From Stored Procedures in C#.NET
Now lets say you want to test it in SQL Server Management Studio...
This gives us a value of 1, as expected.
Now if we want to call this from C#, there is a little trick we have to play with Parameters.
Note the trick we had to play here (line 19) to access the return value after the procedure runs. At first, I tried using:
i=myCommand.ExecuteNonQuery();
...but that always yielded a value of -1.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, October 18, 2011
BindingSource filters: Partial Match on Int Columns
if (!string.IsNullOrEmpty(ticket))This gives a filter line that looks a lot like
{
filter = string.Format("Convert(ID,'System.String') like '%{0}%' ", ticket);
}
"Convert(ID, 'System.String') like %123%"
Which will show all rows where the column ID partially matches 123.
...
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Thursday, September 29, 2011
Mixed Messages
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Thursday, September 8, 2011
TextBox Watermarking in ASP.NET
A google search or two revealed that the industry calls that a TextBox Watermark, and it looks like this:
There are 3 things you need to accomplish this.
CSS styles for the watermarked and unwatermarked boxes.
I added these to my main stylesheet.
Javascript to change the styles...
and the HTML event wireup
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Thursday, September 1, 2011
The Perils of the Fixed Bid
You are in business for yourself - maybe part time - and you get a call. Typically it goes something like this.
How much will it cost to make a web site?
I usually chuckle and say something like "Between $100 and $20million." I have found that people who call for this kind of work don't know what they want from a web site, they have no idea what they want to say to the world, and they think you have this folder full of pre-made web sites that you can drag and drop on the web. Tell them that creating a website is a collaborative process, and if they are interested in keeping costs down, the best way is to have a clear idea what they want to say and it's even better if they have already written most of the text.
Even after this, most of the time the answers will be vague and indefinite, like "All I want is a page to let people know I'm out there." Even at this point, you should avoid giving a fixed price. The last time I created a "5 page" website, it ended up being 18 pages, a database, a photo organizer and lots more. As I said, most people have no idea what it's like to create a site, and once you give them a fixed price, they always (and I mean always) start thinking of more things that are part of the original idea. That "simple page" becomes a shopping cart, private user areas, blog, chat board, and you end up spending the rest of your career working for that original $250 you quoted. The problem isn't them. It's all because you took a vague idea and attached a fixed price to it.
So how do you quote a vague task, like make me a simple company web site?
Quote by the hour.
Tell them that you work on a fixed hourly rate. Tell them that the more details they give you, the faster and less expensive it will be. Tell them that they (not you) will provide logos and text for the site. You will record your time and bill them weekly. You will provide them an estimate, but every time they call up and change anything, the estimate will change. Trust me, they will want changes, and they must be made aware that every single change costs time.
When they say, "Hey, I know I told you I didn't care about colors, but can you change it all to a green and yellow theme?" Don't just say "ok", tell them how much time that will add to the project.
Fight the Fear
The primary fear that your client will have is that your costs will run away and the project will cost many times what you originally quoted. That's why they asked for a fixed quote in the first place. They wanted to budget $250 and get 'it' done. Even though they refused to tell you what 'it' is. Now you've told them that it will be (say) $65 an hour and you have estimated 5 hours' work. They instantly got out a calculator and ran the numbers and they put $325 in their heads and told it to their partners.
The primary tools you need are:
- Clear instructions.
- Good communication
- A written agreement
- A clear understanding that changes - all changes - add time, and if it means redoing something you have already worked on, it means throwing that earlier time away.
- Work your ass off to meet your timelines.
Oh, and how long will my web site take? Facebook took about 15 years and they're still working on it
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
DataGridView: Edit Row on F2
One Solution: There is an EditMode setting called "EditOnF2" which requires the user to hit F2 before editing. It's a lot like locking all edits in your Excel spreadsheets. The user is now required to hit F2 to initiate editing on every cell.
This is annoying. Most all database programs go into edit mode on a per row basis, meaning if you want to edit row 456, you go into edit mode for the entire row, saving changes when you click 'save' or leave the row.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, August 30, 2011
Version Number Fail
I'm building a Windows desktop application and noticed that the version number (after 50+ builds) is 1.0.0.0. So I looked for "Auto increment assembly version and came across this great article.
Ok.
So if you open /Properties/AssemblyInfo.cs you see the following lines...
// Version information for an assembly consists of the following four values:So I changed it to...
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
And what happened? Well for one, it causes this line (elsewhere in my code) to FAIL.
string path = Application.CommonAppDataPath;...thows the error:
System.ArgumentException was unhandledApparently, CommonAppDataPath doesn't look at the built version number, it looks at the text in AssemblyInfo.cs. That's just great!
Message=Illegal characters in path.
Source=mscorlib
StackTrace:
at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
Dearest Microsoft. Please don't tease us with these 'features' that aren't.
The real solution to this would be twofold.
- Make the CommonAppDataPath read the App version as built during the last compile.
- Make another AppDataPath that does not include the version.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Monday, July 25, 2011
Dear Programmers...
When you're making a Windows or Web App I have a few words of advice.
Some processes - like complex database queries - take a lot of time, especially over a large network. This gives a user experience where they click a link or button and nothing happens for a very long time. Wouldn't it be better if you popped up a little I'm working... animation to let the user know you haven't just dropped his request on the floor? Not doing so leads to the following user reactions:
- Screaming in a high-pitched voice, "go! GO! Goooooooooooo!"
- Clicking the offending link or button 32,500 times (submitting repeated requests to the server)
- Hating technology and vowing to leave this over-digitized world to seek a simpler life.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Saturday, July 23, 2011
Some Updates Could Not Be Installed
Security Update for .NET Framework 2.0 SP2 and 3.5 SP1 on Windows Server 2003 and Windows XP x86 (KB2478658)
Security Update for .NET Framework 2.0 SP2 and 3.5 SP1 on Windows Server 2003 and Windows XP x86 (KB2518864)
...
Update: Microsoft advised me to uninstall and reinstall various versions of the .NET framework. Fun. That's 4 hours I'll never get back.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Monday, July 11, 2011
Dear Bloggers...
Thank you.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Monday, July 4, 2011
Common Sense SEO
So, while it sounds good to optimize your search rankings, what exactly are we talking about here? As it turns out, there are 2 kinds of SEO.
There is organic SEO, where the Google and other crawlers read the text on your page and index your site accordingly, and there is the kind that the "SEO Marketing" companies are trying to sell (at least the ones that call me), that are in essence trying to game the Google search bot into giving your site a higher ranking.
Things that do not work.
- Adding a million words to your META tags.
<meta name="Keywords" content="Lindsay Lohan Naked, boobies, naked people, free porn, free money, firefox sucks, IE sucks, Safari sucks, free stuff, make money in your spare time, free drugs, free pharma, free overstock, cancel your credit card debt, no interest loans, low interest loans, free medical care">
...to your site header is trying to rob you. They may make your hits go up for a time, but they will not drive the kind of traffic you want to your site. Now it won't hurt your site per se, as Google completely ignores them, but some other search engines may pick them up and decide how full of crap you are :)
- Paying for links
- Constant site updates
- Hiding text
[
I understand that the web crawlers are getting wise to this tactic as well, but even if they didn't, it still drives traffic you don't want to your pages!
Things that do work.
- Building a reputation.
- Getting recommendations from real people and other businesses.
- Good spelling and punctuation on your pages. (if you're selling mousetraps, and your site says "muosetrap", you're probably not going to get seen.)
- Being connected to social media - is there a twitter/digg/facebook linkamabob on your website? Do you blog about stuff your company does - about your industry - and include links to your site?
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Friday, June 10, 2011
How to make your DataGridView set maxInputLength based on the data cells.
Visual Studio 2010
SQL Server Express database
Visual C# language
I found that when you create a database and use a DataGridView, the column lengths for the string columns are all set to max. This is unacceptable, as the user experience will be an error message AFTER they enter all their data and try to save.
It is an option to go through the DataGridView columns one at a time and set their Max InputLengths, but here, I want to show how to do this programmatically. I perform this function on the load of the form, as the "Layout" even happens whenever you change from minimized to maximized, etc.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Wednesday, March 30, 2011
Super Easy way to Embed Code in Your Blog!
That's when I came across http://pastebin.com/. You can paste in your code, make sure it's right and when you like it, you can get an embed code that works with Blogger, or any other blog engine that allows embed tags.
Problem solved. Case Closed.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, March 29, 2011
Using SQL Server Authentication on SQL Express
But if you need to add just one database app that requires a separate login beyond the Windows login, here's how.
First a few definitions.
SERVER vs. DATABASE
SQL Server (in my case express 2008 R2) is not a Database. In the management studio, when you log into the management studio, you can see that .\SQLEXPRESS (the root node) is called a server. It is important to read this article carefully when I talk about servers vs. databases, as it makes a difference.
LOGIN vs. USER
This is a little more blurry, but a login is not much more than a name, password, and a set of permissions to access the server. A user exists in databases, and has specific roles and permissions in an individual database.
Getting Started
In the Mode
First, make sure your server is in the mode (mood?) to use both kinds of authentication.
Open SQL Server Management Studio and right-click the SERVER name. Pick properties.
Then on the Security tab, make sure SQL Server and Windows Authentication mode is selected.
If it wasn't, then you'll need to save the change and restart SQL Server. If it was already selected you can skip this section.
Restarting SQL Server
Return to the SQL Server Management Studio and right click the Server Name.
Select restart.
Create a Server Login
When we create logins, in general we want to create one login per user. First, log into management studio using windows authentication (or however you normally gain admin access). Under the server tree (not a database tree) select Security- Logins and pick New Login.
Add your login...
Make sure to add a password and select the default database.
On the User Mapping tab...
Select the checkbox by your database.
Enter dbo as the default schema
Check every permission that doesn't contain the word deny.
Note that there are some additional roles in my database that I had added previously.
On the Status tab, make sure grant and enabled are selected.
Click OK.
Using witch-hazel and fairy dust, Management studio will now create your LOGIN to the SERVER, and your USER in the DATABASE.
Look in the Databases tree and find the user created by the wizard.
Open his properties.
The General tab should look much like this.
Testing
To test your new user/login, open a second copy of SQL Server Management Studio.
Change to SQL Server Authentication and enter your user login info.
If you forgot the password (as I did about 6 times while writing this article) you can go back to the login tree in your first SQL Server Management Studio window and change it there, then try again.
Now it's easy to use this login in your programs to access this database. It's also easy to set database level permissions, roles etc.
in C# to create a connection string to access the database do this:
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Friday, March 4, 2011
Using Web Safe Fonts in CSS
If you are editing the stylesheet in Visual Web Developer, and you access the font-family dropdown, Microsoft shows 3 common web-safe fonts and then every font in your system.
This is dumb. Most of us designers have many, many fonts that the average web browsing public has never heard of.
Therefore, I present this list of Web Safe Fonts. Use this list in the font-family settings to achieve the effect you want, with maximum web compatibility.
Web Safe Fonts Preview
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Arial, Helvetica, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Arial Black', Gadget, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Bookman Old Style', serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Comic Sans MS', cursive;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Courier, monospace;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Courier New', Courier, monospace;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Garamond, serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Georgia, serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Impact, Charcoal, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Lucida Console', Monaco, monospace;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'MS Sans Serif', Geneva, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'MS Serif', 'New York', sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Symbol, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Tahoma, Geneva, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Times New Roman', Times, serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: 'Trebuchet MS', Helvetica, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Verdana, Geneva, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Webdings, sans-serif;
The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
font-family: Wingdings, 'Zapf Dingbats', sans-serif;
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Thursday, March 3, 2011
SQL Server 2008 R2 Express
What a bunch of USELESS CRAP!
For those who lack a life, the text in the box below is...
The following notes apply to this release of SQL Server only.And the log file it left says
Microsoft Update
For information about how to use Microsoft Update to identify updates for SQL Server 2008 R2, see the Microsoft Update Web site at http://go.microsoft.com/fwlink/?LinkId=108409.
Samples
By default, sample databases and sample code are not installed as part of SQL Server Setup. To install sample databases and sample code for non-Express editions of SQL Server 2008 R2, see the CodePlex Web site at http://go.microsoft.com/fwlink/?LinkId=87843. To read about support for SQL Server sample databases and sample code for SQL Server Express, see Databases and Samples Overview on the CodePlex Web site at http://go.microsoft.com/fwlink/?LinkId=110391.
Release Notes
For more information about late-breaking changes in this release of SQL Server, see the latest readme file at http://go.microsoft.com/fwlink/?LinkId=141691.
Documentation and Links
To install the .NET Framework SDK, see “Installing the .NET Framework SDK” in SQL Server 2008 R2 Books Online at http://go.microsoft.com/fwlink/?LinkId=141693.
For information about SQL Server 2008 R2 Surface Area Configuration, see the following SQL Server 2008 R2 documentation topics:
In SQL Server 2008 R2 Books Online: “Understanding Surface Area Configuration.”
In SQL Server 2008 R2 Setup Help: “Minimize SQL Server 2008 R2 Surface Area.”
In SQL Server 2008 R2 Books Online on MSDN: Understanding Surface Area Configuration at http://go.microsoft.com/fwlink/?LinkId=141692.
Overall summary:
Final result: Failed: see details below
Exit code (Decimal): -2068052398
Exit facility code: 1212
Exit error code: 1618
Exit message: Failed: see details below
Start time: 2011-03-03 15:55:52
End time: 2011-03-03 16:52:14
Requested action: Upgrade
Log with failure: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110303_155335\sql_engine_core_inst_ctp6_Cpu32_1.log
Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.50.1600.1
Machine Properties:
Machine name: WEB1
Machine processor count: 2
OS version: Windows Server 2003
OS service pack: Service Pack 2
OS region: United States
OS language: English (United States)
OS architecture: x86
Process architecture: 32 Bit
OS clustered: No
Product features discovered:
Product Instance Instance ID Feature Language Edition Version Clustered
Sql Server 2008 SQLEXPRESS MSSQL10.SQLEXPRESS Database Engine Services 1033 Express Edition 10.1.2531.0 No
Sql Server 2008 SQLEXPRESS MSSQL10.SQLEXPRESS SQL Server Replication 1033 Express Edition 10.1.2531.0 No
Sql Server 2008 Management Tools - Basic 1033 Express Edition 10.0.1600.22 No
Package properties:
Description: SQL Server Database Services 2008 R2
ProductName: SQL Server 2008 R2
Type: RTM
Version: 10
SPLevel: 0
Installation location: d:\bf7ec28684b1818f6c3151c67288a7c8\x86\setup\
Installation edition: EXPRESS_ADVANCED
User Input Settings:
ACTION: Upgrade
AGTDOMAINGROUP: <empty>
BROWSERSVCSTARTUPTYPE: Automatic
CONFIGURATIONFILE:
CUSOURCE:
ENU: True
ERRORREPORTING: False
FAILOVERCLUSTERROLLOWNERSHIP: 2
FARMACCOUNT: <empty>
FARMADMINPORT: 0
FARMPASSWORD: *****
FTSVCACCOUNT: <empty>
FTSVCPASSWORD: *****
FTUPGRADEOPTION: Import
HELP: False
IACCEPTSQLSERVERLICENSETERMS: False
INDICATEPROGRESS: False
INSTANCEID: SQLEXPRESS
INSTANCENAME: SQLEXPRESS
ISSVCACCOUNT: NT AUTHORITY\NetworkService
ISSVCPASSWORD: *****
ISSVCSTARTUPTYPE: Automatic
PASSPHRASE: *****
PCUSOURCE:
PID: *****
QUIET: False
QUIETSIMPLE: False
RSCATALOGSERVERINSTANCENAME: Unknown
RSUPGRADEDATABASEACCOUNT:
RSUPGRADEPASSWORD: *****
SQLDOMAINGROUP: <empty>
SQMREPORTING: True
UIMODE: AutoAdvance
X86: False
Configuration file: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110303_155335\ConfigurationFile.ini
Detailed results:
Feature: Database Engine Services
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Client Connectivity
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Client Connectivity SDK
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Writer
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Browser
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Server Replication
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: SQL Compact Edition Runtime
Status: Passed
MSI status: Passed
Configuration status: Passed
Feature: Management Tools - Basic
Status: Passed
MSI status: Passed
Configuration status: Passed
Rules with failures:
Global rules:
Scenario specific rules:
Rules report file: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110303_155335\SystemConfigurationCheck_Report.htm
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, February 22, 2011
SQL Server Money Type Conversion
The easiest way yo do this is to use the C# decimal type.
decimal amount = (decimal)myReader["Amount"];
I had tried double and float, and they both gave me an explicit conversion error.
FYI: when initializing a decimal, use this:
decimal mynumber=0m;
Think of the "m" as "money".
In format strings, use {0:C} (currency format) to display.
string.format("{0:C}",amount);
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Tuesday, January 25, 2011
Junk Posts
All the posts are similar, but they come from IP addresses all over the world. Here are the latest ones:
IP address | event occured | Country |
---|---|---|
125.7.106.36 | 2011-01-25 03:15:01.097 | AUSTRALIA |
194.71.15.242 | 2011-01-25 00:15:28.947 | SWEDEN |
58.1.236.52 | 2011-01-24 23:48:23.503 | JAPAN |
62.189.102.229 | 2011-01-24 22:36:23.813 | UNITED KINGDOM |
84.170.167.1 | 2011-01-24 22:16:55.657 | |
174.133.230.40 | 2011-01-24 21:20:31.047 | UNITED STATES |
71.101.103.247 | 2011-01-24 19:31:49.997 | UNITED STATES |
186.88.170.223 | 2011-01-24 14:23:03.003 | VENEZUELA |
216.185.76.74 | 2011-01-24 08:58:20.940 | CANADA |
193.137.203.231 | 2011-01-24 06:30:30.783 | PORTUGAL |
74.121.148.3 | 2011-01-24 05:55:59.257 | UNITED STATES |
219.234.246.248 | 2011-01-24 03:32:39.443 | CHINA |
68.238.66.113 | 2010-12-09 23:07:47.327 | UNITED STATES |
202.108.50.70 | 2010-12-09 09:54:13.323 | CHINA |
190.177.66.185 | 2010-12-09 05:13:55.220 | ARGENTINA |
212.178.200.72 | 2010-12-09 05:09:22.023 | NETHERLANDS |
200.55.16.50 | 2010-12-09 05:04:51.767 | ARGENTINA |
187.9.58.194 | 2010-12-09 01:14:22.237 | BRAZIL |
212.71.32.94 | 2010-12-09 01:06:39.560 | SAUDI ARABIA |
193.56.241.125 | 2010-12-08 23:53:00.620 | FRANCE |
85.255.197.125 | 2010-12-08 21:19:54.407 | |
79.125.121.121 | 2010-12-08 17:09:40.170 | IRELAND |
The thing would not be alarming but the emails (with the java and HTML removed) are all nearly identical. They all look something like this:
Dx6CQw ccvpfvghxsko, [url=http://qdzwgbbwegwf.com/]qdzwgbbwegwf[/url], [link=http://zadpuhxlkcme.com/]zadpuhxlkcme[/link], http://yvetloauhztz.com/
Don't worry, I tried looking for these domains and they are all unregistered. The real payload of the post must have been in the HTML/JavaScript. It is my hope in posting these that some of you googling upon this page might see this and have some insight as to what the point might be. If so, please comment below.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
Friday, January 21, 2011
Snobs
I had to reinstall Visual Web Developer after a crash. I edited a few old web sites, and apart from it squawking at me about my .NET 3.5 sites not being upgraded, all was well. Ok, so I decided to take a peek at my own web site and perhaps give it a fresh coat of paint.
So I created a new project. I had some great ideas about the menu bar. 3 hours of tormented editing later, it looked just like I wanted. But I wanted the 'current' web page to be displayed in the "selected" style, so I thought I'd open the code window and see if I couldn't make some magic.
Until...
ACK! My whole freaking project is in VISUAL BASIC!
You see, in the 1980's I programmed in GWBASIC. I was young and had no idea what a programming language could be. I moved on to Atari Basic. Then I was working a project on those evil IBM PCs and a friend handed me a Borland Turbo Pascal 2.0 disk.
My God it was great! Fast compiler, fast, efficient code - it rocked my world. And just like that I began looking down on people still using that outdated, slow, interpreted BASIC.
Turbo Pascal led to Paradox, Paradox led to Delphi, and after that, C# and ASP.NET. Each time I moved up a rung, I looked down on those stuck on the level below me. But I also encountered others. People who looked at me and said, "you should switch to MAC" or "you should switch to Linux". I scoffed and called them snobs. Apple Snobs and Linux Snobs. Even within the *nix world, there are POSIX snobs, and UNIX purists, and Red Hat, and Fedora. Let's not even talk about BEOS/HAIKU
Finally - years ago - I realized that all these languages and OSes have their own place, and even though I like to complain bitterly about Redmond, I have to admit that Microsoft products help me get the job done.
Set the TARDIS for this week. That web site, and my three hours of work - polluted with VISUAL BASIC of all things. All my C# snobbery and VB disdain kicked back into high gear. Not that it's a driving campaign in my life, but it's still there. Even worse than my VB-infested web site, I am a snob!
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.