Invoke or BeginInvoke cannot be called on a control until the window handle has been created..

November 21, 2010

If you installing new instance of SQL Server 2008 or adding new features to an existing one and got this error

SQL Server Setup has encountered the following error:
Invoke or BeginInvoke cannot be called on a control until the window handle has been created..

I won’t recommend you to go to http://support.microsoft.com/kb/975055 and waste your time installing SQL Server 2008 SP 1 because it won’t solve the problem.

Solution
Close IE\Explorer windows or anything you can open after doing your installation process 🙂 yes that’s it… weird..

Advertisements

SQL Server 2005/2008 errors during installation

June 24, 2010

2 days to install SQL Server 2008\2005 each time I try; It fails with this error

The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, “How to: View SQL Server 2005 Setup Log Files” and “Starting SQL Server Manually.”

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=29503&EvtType=sqlsetuplib%5cservice.cpp%40Do_sqlScript%40sqls%3a%3aService%3a%3aStart%40x41d

To solve the problem I had to disable the antivirus (BitDefender -what I’ve-) seems it prevents the windows installer to start any services! to over come this prevention stop your antivirus.

Another error message may appear after you install\uninstall SQL Server due to errors in installations…

SQL Server Setup has encountered the following error: The given key was not present in the dictionary..

although I’ve valid\legal SQL Server serial number I don’t know from where this error comes! what I had to is to install “Windows Install Clean Up” to clean any SQL Server installation. download it from http://support.microsoft.com/kb/290301


After installing SSRS! You can’t manage Reports site

March 31, 2010

It’s just a quick tip after you’ve successfully installed SQL Server Reporting Services on Windows Vista or Windows 7, you go to http://{Server-Name}/reports which redirects you to http://{Server-Name}/reports/Pages/Folder.aspx you find out that you can’t control anything and the site looks like this

Don’t worry what you should do is to, right click on Internet Explorer or your favorite browser then run as administrator and retype your SSRS Reports site URL http://{Server-Name}/reports you’ll find you can manage everything as you see

To not open your browser as administrator everytime you manage your Reports you should add your current user as Content Manager or as you wish. From Properties-> New Role Assignment -> Type the username of current user -> Select role -> OK

Open it without run as administrator it will look like as you want.


Replication Error “SQL Server is unable to connect to server..”

February 25, 2010

If you’re working in SQL Server Replication, you may get this message
SQL Server is unable to connect to server ‘Your server name‘.

SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, ‘Another server name‘. (Replication.Utilities)

It always appears as you change the instance name manually or network administrators change the computer name.

Actually your server name still as it’s and not changed with above changes so to avoid getting this message you should write these couple of T-SQL scripts every time you do one or all changes on the instance name

SELECT @@SERVERNAME — you’ll get a strange name, you may didn’t see it before…
GO
sp_dropserver ‘Old server name’ — you got it from pervious select.
GO
sp_addserver ‘SQL server instance name’,’local’ — the name of current instance.
GO
Then, restart the service, and go on you replication work…

#1 Connectivity to SQL Azure

November 13, 2009

I’m enjoying the weekend, with Microsoft SQL Server R2 November CTP and its new features from Database engine features to Analysis Services features, Reporting Service features, etc…

I’ll post a series about those features en shaaa ALLAH in the next days, but let’s begin with Database engine features
#1 connectivity to SQL Azure: what’s SQL Azure? is a cloud-based relational database service built on SQL Server® technologies. To learn more about SQL Azure press here

First you need to have Microsoft SQL Server R2 November CTP, get all about it from here and SQL Azure account (I got it from Microsoft Connect)

1

Open SSMS, and using your Azure account (Server name, username and password) try to login
Read the rest of this entry »


SQL Server 2008 R2 November CTP3

November 11, 2009

SQL Server 2008

Updated on 11/11/2009 7:47 PM

Note: The download links below will launch the Akamai download manager which is designed to provide you with more control over your download experience.

Download now Microsoft SQL Server 2008 R2 November CTP http://care.dlservice.microsoft.com/download/7/B/4/7B4A1F68-4D05-42C1-8982-E5CD8492C6FA/SQLFULL_x86_ENU.exe

Microsoft SQL Server 2008 R2 add-in to Excel that allows very large sets of data to be manipulated efficiently aka Microsoft Gemini now its formal name is PowerPivot

Download: What’s New in SQL Server 2008 R2 November Community Technology Preview (CTP) http://www.microsoft.com/downloads/details.aspx?FamilyID=89550298-D564-40C5-B586-30DC3F909F6F&displaylang=en

It’s now available for download for MSDN and TechNet subscribers,  and it will be available to the general public on November 11th http://blogs.technet.com/dataplatforminsider/archive/2009/11/09/announcing-the-sql-server-2008-r2-november-ctp.aspx


How to create Database User programmatically?

November 3, 2009

Well… we need to assign a server login to has access on a database, let’s say the SQL Server Login we had created programmatically should has access on database “Database1” and for some reasons we should do that programmatically

Well. Create any C# project type (Windows, Class Library or even Console one), add reference to Microsoft.SqlServer.Smo, and Microsoft.SqlServer.ConnectionInfo

/// <summary>

/// Creates database user

/// </summary>

private void CreateDatabaseUser(Database database, String username)

{

User sqlServerUser = new User(datawarehouseDatabase, username); //initializes new User object and we say to which database it belongs and its name

sqlServerUser .UserType = UserType.SqlLogin; //SqlLogin not anything else

sqlServerUser .Login = “login_name”; //associated the user to login name, login name should be valid login name

sqlServerUser .Create();//here’s we create the user on the database and till now the user don’t have any permission on database objects

sqlServerUser .AddToRole(“db_owner”); //or any role like db_databasereader, db_databasewriter,…

}

P.S: There’s catastrophic mistake in Microsoft documentation of User.Login as they documented it as ReadOnly field although it’s not.sqlloginHow we can call the above method?

Server sqlInstance = new Server(

new Microsoft.SqlServer.Management.Common.ServerConnection(

new System.Data.SqlClient.SqlConnection(“.”))); //connects to the local server

Database database = sqlInstance.Databases[“adventureworks”]; //initialize new object from database adventureworks

CreateDatabaseUser(database, “RamyMahrous”); //creates user RamyMahrous on database adventureworks