21.11.11

Cannot connect to Analysis Services version '10.50.1600.1'.

 Here is one of the peculiar issue related to SSAS.

Error Details
---------------------------


Microsoft Visual Studio
---------------------------
Cannot connect to Analysis Services version '10.50.1600.1'.
---------------------------
OK  
---------------------------

Error    1    The project could not be deployed to the 'Venkat-PC' server because of the following connectivity problems :  Cannot connect to Analysis Services version '10.50.1600.1'.  To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.   

------------------------- ---------------------------------------------------------------------------
As usual, I have done the changes specified in the error message. Still, I couldn't figure out the issue.
Eureka, got a strike on this issue.


Can you guess the problem??????????


Solution:

    1. May be ur SSAS port is blocking( add port 2383 to the SQL Server Connections in the Windows Firewall.)
  2. Ensure your SSAS services and Browser services is running fine in Services.msc console.
  3. Right click on the project properties and check the deployment server as your server name instead of "local host"
  4. Finally :-) Do not open your project in Microsoft Visual studio console. Instead try to open the BIDS tool to deploy your cubes. Some how, SSAS is not allowing the users to deploy the cubes from this console. (here is the mistake, I have done) Fortunately resolved it.


Cheers,
Venkatesan Prabu .J

19.11.11

Issue with DatetimePicker data

Error String: The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.

  The reason for this issue is, the application is trying to convert the data from DateTimePicker to datetime and it's failing.

   The reason is, I;ve tried to pick the data wrongly. dtTimePicker.ToString() -> Instead we have to use dtTimePicker.Text.

Cheers,
Venkatesan Prabu .J

16.11.11

404 Errors after clicking Wordpress links

404 Errors - Page Not found issue. After clicking Wordpress links

Here is the steps to escape from this issue.

  1. Login to the WordPress Dashboard
  2. Click of Settings on the menu on the left hand side.
  3. Click on Permanlinks under Settings.
  4. Remember which setting it is set on now.  (If you are using a custom structure, copy or save the custom structure somewhere.)
  5. Select Default
  6. Click on Save Changes    --- Stay here and check your site. It will work fine :-)
  7. Change it back to the setting it was on before you selected Default. (Put the custom structure back if you had one.)
  8. Click Save Changes
If the above steps didn't fix your issue. Then, change the .htaccess file.

 # BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress 

Option2: 

rename the .htaccess file. change the permalink settings. This will generate the new .htaccess file and you are able to login perfectly.

Cheers,
Venkatesan Prabu. J
Head, Kaashiv Infotech
Chennai.

4.11.11

Carefull while copying the code from pdf

I've happened to copy a small test code from PDF and while executing, I got the below error.

System.Windows.Markup.XamlParseException: Invalid character in the given encoding. Line 1, position 13.

The reason is due to Double quotes and it's not a technical bad code :-)

Be careful while copying the code from PDF. Mostly, it won't work due to this kind of simple issues.

Cheers,
Venkatesan Prabu .J
Head - Kaashiv infotech
www.kaashivinfotech.com

2.11.11

Enabling delay process in c#



To achieve a delay in processing, you have add the name space

using System.Threading;

Add the below code in the place where you want the delay

Thread.Sleep(200);

Cheers,
Venkatesan Prabu .J
Head, Kaashiv infotech,
Chennai
http://www.kaashivinfotech.com/
 

Auto Scroll option in List box


Here is a small code snippet to scroll the content in List box. (If the items are more)

In the top, you should add the code 

this.listBox1.TopIndex = 0;

After wards, you have to modify the index of the list box slowly.

listBox1.Items.Add(line);
this.listBox1.TopIndex = listBox1.Items.Count - 1;

Check my previous post for the entire piece of code.

Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech,
Chennai.

WWW.kaashivinfotech.com

Read text file line by line in C#

I happened to work on files. My condition to read the file line by line.

Here is a small piece of code to read the file line by line.... I got the snippet from Microsoft BOL.

private void btnBrowse_Click(object sender, EventArgs e)
        {
            int counter = 0;
            string line;
            rtb_filecontent.Text = "";
            // Read the file and display it line by line.
            System.IO.StreamReader file =
               new System.IO.StreamReader("D:\\1.txt");
            this.listBox1.TopIndex = 0;
            while ((line = file.ReadLine()) != null)
            {
               // rtb_filecontent.Text = rtb_filecontent.Text + "\n" + line;
                listBox1.Items.Add(line);
                //rtb_filecontent.AutoScrollOffset = new Point(rtb_filecontent.AutoScrollOffset.Y, 10);
                Thread.Sleep(200);
                counter++;
            }

            file.Close();           
        }

Happy Coding
Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech.
Chennai

www.kaashivinfotech.com


1.11.11

Quoting the input string with the specified character

While focusing injection related issue, I happen to look into the function QuoteName method in SQL Server. It's used to Enclose or Quote a string with the specified character string.

Consider the below query, am asking SQL Server to enclose the string with [ ] (Bracket)

SELECT QUOTENAME('abc  [   ] def','[]')


The output is,

[abc  [   ]] def]

This function is really useful to enclose the string with the specified literal and avoid SQL Injection issues while passing the parameter.

Cheers,
Venkatesan Prabu .J
www.kaashivinfotech.com

Listing down Server directories in SQL Server




Listing down the directories in the server:

       
   Below is the command used to list down the directories in the server.

       exec master..xp_cmdshell 'dir'



Thanks and Regards,
Venkatesan Prabu .J
Microsoft MVP
Head - KaaShiv InfoTech
Chennai.

www.kaashivinfotech.com

Error in executing xp_cmdshell command

xp_cmdshell is one of the important command to access the system resources.

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

Solution:

As told in my previous post, by default highly secure system related properties will be made disabled.

EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE

Cheers,
Venkatesan Prabu .J
Head - KaaShiv InfoTech,
www.kaashivinfotech.com

Error in executing OpenRowset or OpenDatasource queries

While executing  OpenRowset or OpenDatasource queries, you will get the below error.

SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries',

Solution:

By default, SQL Server will disable the options related to the server. We need to enable the same by executing the below queries.

EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE WITH OVERRIDE

Cheers,
Venkatesan Prabu. J
Head  - Kaashiv InfoTech, Chennai

My T-SQL Gallery @code.msdn.microsoft


Created my own T-SQL Gallery in Microsoft site. Do visit the same and share your feedback,

http://code.msdn.microsoft.com/VenkatSQLSample/Thread/List.aspx

Thanks and Regards,
Venkatesan Prabu .J

SQL Server Interview questions - Part 1

What is the significance of NULL value and why should we avoid permitting null values?
Null means no entry has been made. It implies that the value is either unknown or undefined.We should avoid permitting null values because Column with NULL values can't have PRIMARY KEY constraints. Certain calculations can be inaccurate if NULL columns are involved.

What is SQL whats its uses and its component ?
The Structured Query Language (SQL) is foundation for all relational database systems. Most of the large-scale databases use the SQL to define all user and administrator interactions. It enable us to retrieve the data from based on our exact requirement. We will be given a flexibility to store the data in our own format.


The DML component of SQL comprises four basic statements:
* SELECT to get rows from tables
* UPDATE to update the rows of tables
* DELETE to remove rows from tables
* INSERT to add new rows to tables


What is DTS in SQL Server ?
Data Transformation Services is used to transfer the data from one source to our required destination. Considering am having some data in sql server and I need to transfer the data to Excel destination. Its highly possible with dialogue based tool called Data Transformation services. More customization can be achieved using SSIS. A specialized tool used to do such migration works.


What is the difference between SQL and Pl/Sql ?

Straight forward. SQL is a single statement to finish up our work.Considering, I need some data from a particular table. “Select * from table” will fetch the necessary information. Where as I need to do some row by row processing. In that case, we need to go for Procedural Logic / SQL.

What is the significance of NULL value and why should we avoid permitting null values?
Null means no entry has been made. It implies that the value is either unknown or undefined.We should avoid permitting null values because Column with NULL values can't have PRIMARY KEY constraints. Certain calculations can be inaccurate if NULL columns are involved.

Difference between primary key and Unique key?
Both constraints will share a common property called uniqueness. The data in the column should be unique. The basic difference is,
· Primary key won’t allow null value. Whereas, unique key will accept null value but only one null value.
· On creating primary key, it will automatically format the data inturn creates clustered index on the table. Whereas, this characteristics is not associated with unique key.
· Only one primary key can be created for the table. Any number of Unique key can be created for the table.

Select Statement in SQL Server

Select Statement in SQL Server

String Functions in sql server

String Functions in sql server
Substring/Len/replace/Ltrim/Rtrim

SQL Server Interview Question - Part 2

What is normalization?

Normalization is the basic concept used in designing a database. Its nothing but, an advise given to the database to have minimal repetition of data, highly structured, highly secured, easy to retrieve. In high level definition, the Process of organizing data into tables is referred to as normalization.


What is a stored procedure:
Stored procedures are precompiled T-SQL statements combined to perform a single task of several tasks. Its basically like a Macro so when you invoke the Stored procedure, you actually run a set of statements. As, its precompiled statement, execution of Stored procedure is compatatively high when compared to an ordinary T-SQL statement.


What is the difference between UNION ALL Statement and UNION ?
The main difference between UNION ALL statement and UNION is UNION All statement is much faster than UNION,the reason behind this is that because UNION ALL statement does not look for duplicate rows, but on the other hand UNION statement does look for duplicate rows, whether or not they exist.

Example for Stored Procedure?
They are three kinds of stored procedures,1.System stored procedure – Start with sp_2. User defined stored procedure – SP created by the user.3. Extended stored procedure – SP used to invoke a process in the external systems.Example for system stored proceduresp_helpdb - Database and its propertiessp_who2 – Gives details about the current user connected to your system. sp_renamedb – Enable you to rename your database


What is a trigger?

Triggers are precompiled statements similar to Stored Procedure. It will automatically invoke for a particular operation. Triggers are basically used to implement business rules.


What is a view?
If we have several tables in a db and we want to view only specific columns from specific tables we can go for views. It would also suffice the needs of security some times allowing specfic users to see only specific columns based on the permission that we can configure on the view. Views also reduce the effort that is required for writing queries to access specific columns every time.


What is an Index?
When queries are run against a db, an index on that db basically helps in the way the data is sorted to process the query for faster and data retrievals are much faster when we have an index.


What are the types of indexes available with SQL Server?

There are basically two types of indexes that we use with the SQL ServerClustered -

1. It will format the entire table, inturn physically sort the table.

2. Only one clustered index can be created for a table.

3. Data will be located in the leaf level.

4. By default, primary key will create clustered index on the table.

Non-Clustered Index

1. It wont touch the structure of the table.

2. It forms an index table as reference to the exact data.

3. A reference to the data will be located in the leaf level.

4. For a table, we can create 249 non clustered index.

Happy Learning!!!
Regards,
Venkatesan Prabu .J

SQL Interview question

Extent Vs Page?

Pages are low level unit to store the exact data in sql server. Basically, the data will be stored in the mdf, ldf, ndf files. Inturn, pages are logical units available in sql server.The size of the page is 8KB.

Eight consecutive pages will form an extent 8 * 8KB = 64KB.

Thus I/O level operation will be happening at pages level.The pages will hold a template information at the start of each page (header of the page).

They are,

1. page number,

2. page type,

3. the amount of free space on the page,

4. the allocation unit ID of the object that owns the page.

Extents will be classifed into two types,

1. Uniform extents

2. Mixed extents

Uniform Extents:It occupied or used by a single object. Inturn, a single object will hold the entire 8 pages.Mixed

Extents:Mulitple objects will use the same extent. SQL Server will allow a max of eight objects to use a shared extent.

Property of SQL Server :Initally if an object is created, sql server will allocate the object to the mixed extent and once if the size reaches 8 pages and more... immediately, a new uniform extent will be provided for that particular object.

Herecomes, our fragmentation and reindexing concepts.



Best Joke - Enjoy it

Best Joke - Enjoy it