Tuesday, August 7, 2012

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure resources was correctly embedded or linked into assembly at compile time, or that all the satellite assemblies required are loadable and fully signed.

I have some images on button and icons on form and the above message display whenever there is any image try to assign to a button or icon to a form. I have wasted my one day just to find out what I made wrong with my desktop application during uploading it on Visual Source Safe and was amazed when I found it. During this time, I read solutions on different sites and blogs which I am writing below but this does not resolve the issue.

1) Check Project Namespace by going to properties of project. (Right click on project and select properties)

2) Resources.resx file in Properties folder of project might not contain same name which you mentioned in project namespace.

3) Remove all files from "bin" folder inside project and re-build your project again.

All methods I tried, but of no use.... Then I find out that I include following two folders which were excluded from project and these were

1) Bin
2) Obj

out of that when I again exclude obj folder from my project. It start work fine. This solution worked for me and I hope that it will also help you.

If this solution help you then please write your comments so that other find it as a valuable content.

Thanks.

Sunday, March 25, 2012

wamp server turn to yellow color

When I install wamp sever on my laptop, I face subjected problem. The wamp server turns to yellow instead of green. To fix it follow below mentioned steps:

1) Stop IIS Server (type inetmgr.exe in run command)
2) Locate httpd.config file (default path is C:\wamp\bin\apache\Apache2.2.21\conf)
3) Locate below lines
#Listen 12.34.56.78:80
Listen 80

and change them with
#Listen 12.34.56.78:8080
Listen 8080.

Save httpd.config file and restart wamp services. You can see that it will be now changed into green color.

Please comment if this post is helpful for you.

Wednesday, February 1, 2012

Cannot use the special principal 'sa'. (Microsoft SQL Server, Error: 15405)

Yesterday, I start SQL Server 2005 and try to connect with sa user but was enable to connect with the 'sa' user and got this error:

Cannot use the special principal 'sa' (Microsoft SQL Server, Error: 15405)

After doing some google, I found out the solution which I am sharing so that others can get all the possible solutions from this article.

The titled message mean that your sa user is disabled. To enable it, you have to follow below mentioned steps:

1) you have to change the authentication mode: go to Management Studio and open Object Explorer. Connect to your server and right-click on the server name, then select Properties. Go to Security tab and under Server Authentication select "SQL Server and Windows Authentication Mode".

2) Also, after you follow the directions above, you will also need to explicitly enable the sa account as well. Go to Security->Logins. Right-click on the "sa" account, select "Properties". In the list on the left, select "Status" and under "Login" on the right, make sure "Enable" is selected.

3) exec sp_changedbowner 'sa','true' in query editor after selecting the database whom you want to assign user sa.

4) You can also change the password of sa (it's better to change the password).

After performing all above mentioned changes, Exit with SQL Management Studio. Restart Sql Service from services.msc.

Open Management Studio again and try to login "sa". Hopefully, it works. Enjoy!

(Please comment if it work for you).

Thursday, September 30, 2010

EXTRACT DATA FROM XLS AND XLSX FILE FORMAT

Dear All,

Todays post is about how to load data from excel sheet. This post is emphasized on following file formats:

1) xls (Excel Sheet 1997-2003)
2) xlsx (Excel Sheet 2007)

Both sheets require connection string to extract data from sheet.

Connection String for xls:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Sample1.xls;Extended Properties=Excel 8.0"

Connection String for xlsx:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Sample.xlsx;Extended Properties=Excel 12.0"

Below is a small program for your understanding. The program is in ASP.NET.

protected void Page_Load(object sender, EventArgs e)
{
string connString = ConfigurationManager.ConnectionStrings["xls"].ConnectionString;
// Create the connection object
OleDbConnection oledbConn = new OleDbConnection(connString);
// Open connection
oledbConn.Open();
// Create OleDbCommand object and select data from worksheet Sheet1
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
// Create new OleDbDataAdapter
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
// Create a DataSet which will hold the data extracted from the worksheet.
DataSet ds = new DataSet();
// Fill the DataSet from the data extracted from the worksheet.
oleda.Fill(ds, "Employees");
// Bind the data to the GridView
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}

I hope this will help you.

Thursday, July 15, 2010

SQL Statement OpenDataSource

SELECT *
FROM OPENDATASOURCE('SQLNCLI',
'Data Source=10.20.2.218;uid=sa;pwd=sa').
cardrequests.dbo.tbl_customer_Sql

Saturday, May 1, 2010

The credentials you provided for the SQL server Agent service are invalid. To continue, provide valid account and password for the SQL server Agent Se

The credentials you provided for the SQL server Agent service are invalid. To continue, provide valid account and password for the SQL server Agent Service.

Today, I have decided to install SQL SERVER 2008 on my PC. All was going fine until I came to server configuration page/tab. I was halted for half an hour to insert correct credential to move to the next page. If you are also getting the same trouble then just enter following data in Account name and password:

Account Name : "NT AUTHORITY\NETWORK SERVICE "
Password : Blank

I hope this will resolve your issue.

FORMATTING NUMBERS IN SQL

To format numbers in sql queries in SQL SERVER 2005, use the following command

Select Convert(nvarchar,cast(123123323 as money),1)

This will convert the following number 123123323 to 123,123,323.00

Docker Tutorial

 I have listed all the necessary commands of Docker below. In case if any is missing or if any improvement required, please share in comment...