While working on ubuntu, some files and folders might not be accessible due to permission settings.
For example it is not possible to add/delete files or folders to /var/lib/mysql folder. But, this is one of the folders that one might one to visit with changes – like if you want to move the data files..
There is a tool in this regard:
1. Go to Applications->Accessories->Terminal
2. on the CLI, write sudo chmod OGE /folder/or/file/path
The first stands for owner, second for group, and third everyone. Each of these are going to be filled with numbers ranging from 1-7.
The permissions primarily include read, write and execute.
the most common for controlled usage is
sudo chmode 777 /folder/or/file/path
which means Owner can read write and execute and the same for Group and everyone
For recursive permission allocation
sudo chmode 777 -R /folder/or/file/path
For more visit https://help.ubuntu.com/community/FilePermissions
While working smoothly on ASP.NET, sometimes the page would stop responding to the server and plate ‘offline’ at the top. Some controls like calendar would stop responding while selecting the date.
For this problem, the solution is easy – just go to file menu of IE and uncheck ‘work offline’ – good to go!
You can manage size before upload by messing web.config’s maxRequestLength attribute and
you can also validate and cancel posting of the form using customvalidation control and you can write what ever logic on the customValidator’s code part
A more nice approach can be found here http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.saveas.aspx
Working on my current project, I come up with a scenario to switch a visitor to a new page after some process.
Here I have an option to use either redirect() or server.transfer(). So what are the tradeoffs:
- Redirect() would allow to navigate to other pages out of the current website unlike Transfer()
- Redirect() needs a round-trip to client page but transfer() won’t need this which would make transfer() a bit fast
Well for my case, I am not redirecting to other page and I want it to be fast so – I have used Server.Transfer().
For questions related to page transfer refer http://msdn.microsoft.com/en-us/library/x3x8t37x.aspx
Postback in simple terms is self referal of the page. In earlier version of ASP, the form would ‘POST’ values to another page for validation or some process using the post method.
But in ASP.NET, the page which accepts the values through its form would be responsible for validating/processing the values.
More @ http://www.codersource.net/asp_net_post_back.html
If you want to add primary key after you create the table in the sql server, then
1. go to Microsoft SQL Server Management Studio
2. Right click on the database and select new query
3. ALTER TABLE tbl_name ADD PRIMARY KEY(pr_key_column);
tbl_name – name of the table you want to assign primary key
pr_key_column – column/field name which you want it to be primary key
If the pr_key_column is allowed null values, then you can’t assign it as primary key. So if that is the case use this query first:
ALTER TABLE tbl_name ALTER COLUMN pr_key_column datatype not null;
To revoke primary key:
ALTER TABLE tbl_name DROP CONSTRAINT(pr_key_column);
A good information with explanation is found here
While you are trying to install MS SQL Server 2008 on the machine which already has Visual studio, you might come up with this problem.
Here is the remedy.
Go to command prompt and move to the MS SQL Server installation DVD like:
C:…>E: – assuming your DVD drive letter is ‘E’
Then provide the following command:
SETUP /action=install /skiprules=vsshellinstalledrule
While you are installing, you might come up with error message but pass it selecting ok.
The other solution might be the trivial one – uninstall VS and install MS SQL Server then install VS –
I hope it will help a lot.
First access the files of the database (MYI, MYD, FRM) from the existing database by going to
/var/lib/mysql/(your database) – This path holds true for ubuntu
Then go to the new server and put it in the same place
restart your server and mysql then view it through phpmyadmin.