DECLARE @jobs TABLE
( jobcount int
)
INSERT
INTO @jobs
EXEC
sp_executesql
N’select 1 AS jobcount’
SELECT
*
FROM @jobs
Friday, July 8, 2011
Tuesday, July 5, 2011
How to recover suspect SQL server 2008 Database
DBCC CHECKDB (’YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS
Then run below query
EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(’yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
Then run below query
EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(’yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
Tuesday, June 21, 2011
SC command - Access denied
http://kevin.vanzonneveld.net/techblog/article/allow_windows_users_to_restart_service/
Friday, March 25, 2011
folders are hidden in pen drive
1. click start>>run>>type in "cmd"
2. type the location of your flash drive.. e.g. "d:", "e:", "f:", etc..
3. type "dir /ah"
*you will now see the files/folders with hidden attributes
4. type "attrib [name of file/folder] -r -a -s -h"
*if you're going to unhide files, you should type the whole name plus the extension (format).. example "attrib party.jpg -r -a -s -h"
**if you have folders with 6 characters and above, type the first 6 characters then "~1".. example for folder named "birthday"
"attrib birthd~1 -r -a -s -h"
5. you should repeatedly type dir /ah after unhiding some files/folders so you'll know if they're now working or not..
6. now check you flash drive.. it should be there..
2. type the location of your flash drive.. e.g. "d:", "e:", "f:", etc..
3. type "dir /ah"
*you will now see the files/folders with hidden attributes
4. type "attrib [name of file/folder] -r -a -s -h"
*if you're going to unhide files, you should type the whole name plus the extension (format).. example "attrib party.jpg -r -a -s -h"
**if you have folders with 6 characters and above, type the first 6 characters then "~1".. example for folder named "birthday"
"attrib birthd~1 -r -a -s -h"
5. you should repeatedly type dir /ah after unhiding some files/folders so you'll know if they're now working or not..
6. now check you flash drive.. it should be there..
Sunday, March 13, 2011
Jquery Auto complete plugin
$("#txtSearch").autocomplete("/test/searchitembyCode",{ matchCase: false ,
parse: prep_data,
formatItem: function(item) {
return item.Title;
}
}).result(function(event, item) {
alert(item.Id);
});
// Handle data from ajax request
prep_data = function(data){
tmp = eval('(' + data + ')');
parsed_data = [];
for (i=0; i < tmp.length; i++) {
obj = tmp[i];
// Other internal autocomplete operations expect
// the data to be split into associative arrays of this sort
parsed_data[i] = {
data: obj ,
value: obj.Id,
result: obj.Title
};
}
return parsed_data
}
parse: prep_data,
formatItem: function(item) {
return item.Title;
}
}).result(function(event, item) {
alert(item.Id);
});
// Handle data from ajax request
prep_data = function(data){
tmp = eval('(' + data + ')');
parsed_data = [];
for (i=0; i < tmp.length; i++) {
obj = tmp[i];
// Other internal autocomplete operations expect
// the data to be split into associative arrays of this sort
parsed_data[i] = {
data: obj ,
value: obj.Id,
result: obj.Title
};
}
return parsed_data
}
Saturday, February 5, 2011
Fuzzy search or Lookup to find out percentage matching between records
Below link has extra ordinary article to find percentage matching between records of table.
http://anastasiosyal.com/archive/2009/01/11/18.aspx
http://anastasiosyal.com/archive/2009/01/11/18.aspx
Tuesday, November 16, 2010
Amazon web service ISBN Search
String DESTINATION = "https://ecs.amazonaws.com/onca/soap?Service=AWSECommerceService";
String MY_AWS_ID = "ACCESS_ID";
String MY_AWS_SECRET = "SECRET_ID";
ItemSearchRequest objRequest = new ItemSearchRequest();
objRequest.SearchIndex = "Books";
objRequest.Power = "ISBN:9780557230648";
objRequest.ResponseGroup = new string[] { "Small", "AlternateVersions", "Large", "Medium", "Offers" };
objRequest.Sort = "salesrank";
ItemSearchRequest[] requests = new ItemSearchRequest[] { objRequest };
ItemSearch itemSearch = new ItemSearch();
itemSearch.AWSAccessKeyId = MY_AWS_ID;
itemSearch.Request = requests;
// create an instance of the serivce
AWSECommerceService api = new AWSECommerceService();
// set the destination
api.Destination = new Uri(DESTINATION);
// apply the security policy, which will add the require security elements to the
// outgoing SOAP header
AmazonHmacAssertion amazonHmacAssertion = new AmazonHmacAssertion(MY_AWS_ID, MY_AWS_SECRET);
api.SetPolicy(amazonHmacAssertion.Policy());
// make the call and print the title if it succeeds
try
{
ItemSearchResponse response = api.ItemSearch(itemSearch);
Items info = response.Items[0];
Item[] items = info.Item;
for (int i = 0; i < items.Length; i++) { Label1.Text += "Book Title: " + items[i].ItemAttributes.Title.ToString() + "<br />";} } catch (Exception ex) { Label1.Text += ex.Message.ToString(); }
Note:-
==================================================
AmazonHmacAssertion class is available in client project of below link
http://associates-amazon.s3.amazonaws.com/signed-requests/samples/amazon-product-advt-api-sample-csharp-soap.zip
String MY_AWS_ID = "ACCESS_ID";
String MY_AWS_SECRET = "SECRET_ID";
ItemSearchRequest objRequest = new ItemSearchRequest();
objRequest.SearchIndex = "Books";
objRequest.Power = "ISBN:9780557230648";
objRequest.ResponseGroup = new string[] { "Small", "AlternateVersions", "Large", "Medium", "Offers" };
objRequest.Sort = "salesrank";
ItemSearchRequest[] requests = new ItemSearchRequest[] { objRequest };
ItemSearch itemSearch = new ItemSearch();
itemSearch.AWSAccessKeyId = MY_AWS_ID;
itemSearch.Request = requests;
// create an instance of the serivce
AWSECommerceService api = new AWSECommerceService();
// set the destination
api.Destination = new Uri(DESTINATION);
// apply the security policy, which will add the require security elements to the
// outgoing SOAP header
AmazonHmacAssertion amazonHmacAssertion = new AmazonHmacAssertion(MY_AWS_ID, MY_AWS_SECRET);
api.SetPolicy(amazonHmacAssertion.Policy());
// make the call and print the title if it succeeds
try
{
ItemSearchResponse response = api.ItemSearch(itemSearch);
Items info = response.Items[0];
Item[] items = info.Item;
for (int i = 0; i < items.Length; i++) { Label1.Text += "Book Title: " + items[i].ItemAttributes.Title.ToString() + "<br />";} } catch (Exception ex) { Label1.Text += ex.Message.ToString(); }
Note:-
==================================================
AmazonHmacAssertion class is available in client project of below link
http://associates-amazon.s3.amazonaws.com/signed-requests/samples/amazon-product-advt-api-sample-csharp-soap.zip
Subscribe to:
Posts (Atom)