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..
Friday, March 25, 2011
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
Wednesday, October 6, 2010
FileUpload with Updatepanel and PostbackTrigger not working at first time,
Page.Form.Attributes.Add("enctype", "multipart/form-data");
Tuesday, October 5, 2010
configure log4Net
Web.Config:-
under configsection
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="logs\\error_04112009.log" />
<param name="AppendToFile" value="true"/>
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p%d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
<logger name="File">
<level value="All" />
<appender-ref ref="LogFileAppender" />
</logger>
</log4net>
Global.asax:-
void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
}
under configsection
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="logs\\error_04112009.log" />
<param name="AppendToFile" value="true"/>
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p%d{yyyy-MM-dd hh:mm:ss} - %m%n" />
</layout>
</appender>
<logger name="File">
<level value="All" />
<appender-ref ref="LogFileAppender" />
</logger>
</log4net>
Global.asax:-
void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
}
Monday, September 27, 2010
Paging using SP
SET @StartRow = (@PageIndex - 1) * @PageSize + 1
SET @EndRow = @StartRow + @PageSize - 1
SET @StartRow = (@PageIndex - 1) * @PageSize + 1
SET @EndRow = @StartRow + @PageSize - 1
SET @TotalRec = Select Count(*) from Test
-- If StartRow is less then Total Records then fetch all records between startrow and endrow else ignore start row only consider endrow
IF @StartRow <= @TotalRecords SET @SQL = ' SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY '+@Sort+') as [RowNumber] from Test )T1 WHERE RowNumber >= @StartRow AND RowNumber <= @EndRow'
SET @ParmDefinition = N'@StartRow int,@EndRow int,@Sort nvarchar(50)';
EXECUTE sp_executesql @SQL,@ParmDefinition,@StartRow=@StartRow,@EndRow=@EndRow,@Sort=@Sort;
END
ELSE
BEGIN
SET @SQL = '
SELECT *
FROM (
SELECT *,
ROW_NUMBER() OVER (ORDER BY '+@Sort+') as [RowNumber]
from Test
)T1
WHERE RowNumber <= @EndRow'
SET @ParmDefinition = N'@StartRow int,@EndRow int,@Sort nvarchar(50)';
EXECUTE sp_executesql @SQL,@ParmDefinition,@StartRow=@StartRow,@EndRow=@EndRow,@Sort=@Sort;
END
RETURN @TotalRec
SET @EndRow = @StartRow + @PageSize - 1
SET @StartRow = (@PageIndex - 1) * @PageSize + 1
SET @EndRow = @StartRow + @PageSize - 1
SET @TotalRec = Select Count(*) from Test
-- If StartRow is less then Total Records then fetch all records between startrow and endrow else ignore start row only consider endrow
IF @StartRow <= @TotalRecords SET @SQL = ' SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY '+@Sort+') as [RowNumber] from Test )T1 WHERE RowNumber >= @StartRow AND RowNumber <= @EndRow'
SET @ParmDefinition = N'@StartRow int,@EndRow int,@Sort nvarchar(50)';
EXECUTE sp_executesql @SQL,@ParmDefinition,@StartRow=@StartRow,@EndRow=@EndRow,@Sort=@Sort;
END
ELSE
BEGIN
SET @SQL = '
SELECT *
FROM (
SELECT *,
ROW_NUMBER() OVER (ORDER BY '+@Sort+') as [RowNumber]
from Test
)T1
WHERE RowNumber <= @EndRow'
SET @ParmDefinition = N'@StartRow int,@EndRow int,@Sort nvarchar(50)';
EXECUTE sp_executesql @SQL,@ParmDefinition,@StartRow=@StartRow,@EndRow=@EndRow,@Sort=@Sort;
END
RETURN @TotalRec
Subscribe to:
Posts (Atom)