Friday, May 31, 2013

vbLf alternate in C#

You can
vbCr = "\r"
vbLf = "\n"
vbCrLf = "\r\n"

Read HTML file in ASP.Net C#

  private void LoadStatement()
         {
         try
         {
            //Open a file for reading
            string FILENAME= Server.MapPath("ics.htm");
            StreamReader objStreamReader = File.OpenText(FILENAME);
            string contents= objStreamReader.ReadToEnd();
            objStreamReader.Close();
            contents = contents.Replace("<br /><br />", "\n");
            contents = contents.Replace("<br />", "\n");
            contents = RemoveHTML(contents);
            string strAgreement = "Independent Contractor Statement \r\n \r\n"+ contents;
            txtAgreement.Text = strAgreement;
         }
        catch{}
         }

Click here to see code in VB

Read HTML file in asp.net VB

 Protected Sub LoadStatement()

        Try
            'Open a file for reading
            Dim FILENAME As String = Server.MapPath("agreement.htm")

            'Get a StreamReader class that can be used to read the file
            Dim objStreamReader As StreamReader
            objStreamReader = File.OpenText(FILENAME)

            'Now, read the entire file into a string
            Dim contents As String = objStreamReader.ReadToEnd()
            objStreamReader.Close()
            contents = contents.Replace("<br /><br />", vbCrLf)
            contents = contents.Replace("<br />", vbCrLf)
            contents = RemoveHTML(contents)
            Dim strAgreement As String
            strAgreement = "Independent Contractor Agreement" & vbCrLf & vbCrLf & contents

            txtAgreement.Text = strAgreement
        Catch ex As Exception

        End Try

Click here to see code in C# 

Thursday, May 30, 2013

RegisterForEventValidation can only be called during Render() ASP.NET

The prefect solution is use EnableEventValidation="false" in Page tag.

<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" EnableEventValidation="false"
    CodeFile="checkout.aspx.cs" Inherits="LD.checkout" %>

 private string RenderGridView()
        {
            string returnvalue = string.Empty;
            try
            {
                StringWriter stringWrite = new StringWriter();
                HtmlTextWriter writer = new HtmlTextWriter(stringWrite);
                VerifyRenderingInServerForm(GridView2);
                GridView2.RenderControl(writer);
                returnvalue = writer.InnerWriter.ToString();
            }
            catch (Exception ex)
            {

            }
            return returnvalue;
        }
        public override void VerifyRenderingInServerForm(Control control)
        {
            return;
        }

Wednesday, May 22, 2013

Auto Update A datagrid/Grdiview by Timer in asp.net C#

 using System.Data.SqlClient;
using System.Data;

 protected void Timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                BindGridView();
            }

            catch { }
        }
        #region Bind datagrid Grdiview
        private void BindGridView()
        {
            SqlDataAdapter adp = new SqlDataAdapter("Select * from TableName", mySqlConnection);
            DataSet ds = new DataSet();
            adp.Fill(ds);
            try
            {
                DataView dv = new DataView(ds.Tables[0]);
                gdvListing.DataSource = dv;
                gdvListing.DataBind();
                if (gdvListing.Rows.Count <= 0)
                {
                    ltrErrorMsg.Text = "No Record Found.";
                }
            }
}

Click here to see ASPX html and Gridview Binding

How auto update a DataGrid in 1 seconds without refreshing page in asp.net

<asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
        <%--<asp:PostBackTrigger ControlID="btnSubmit" />--%>
    </Triggers>
    <ContentTemplate>
     <asp:Timer runat="server" id="UpdateTimer" interval="2000"  OnTick="Timer1_Tick"  />
                        <asp:GridView Width="100%" ID="gdvListing" runat="server" GridLines="none" BackColor="#E6DCC3" CssClass="Forummainhead"
                            DataKeyNames="ProductId" AutoGenerateColumns="False" AllowPaging="True"
                            OnPageIndexChanging="gdvListing_PageIndexChanging" OnRowDataBound="gdvListing_RowDataBound"
                             CellSpacing="1" CellPadding="2" BorderWidth="0" EmptyDataRowStyle-Font-Bold="true">
                            <HeaderStyle HorizontalAlign="center" CssClass="Grid_HeaderStyle"   />
                            <RowStyle HorizontalAlign="left" CssClass="row0" />
                            <AlternatingRowStyle HorizontalAlign="left" CssClass="row1" />
                            <Columns>
                               <asp:TemplateField HeaderText="Product Name" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <a href="ProductAddEdit.aspx?ID=<%#DataBinder.Eval(Container.DataItem, "ProductId") %>" >
                                            <%# DataBinder.Eval(Container.DataItem, "Name")%>
                                        </a>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="User Name" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                         <%# DataBinder.Eval(Container.DataItem, "UserName")%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Current bid Amount" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "CurrentBidAmount")%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="Bid Min. Amount" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "BidMinValue")%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="MRP" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "MRP")%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sold" HeaderStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "IsSold")%>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                               
                               
                                </Columns>
                            <PagerSettings Mode="NumericFirstLast" Position="Bottom" />
                            <EmptyDataRowStyle CssClass="row0" Font-Underline="False" HorizontalAlign="center"
                                VerticalAlign="Middle" Width="100%" />
                            <PagerStyle CssClass="form_header" Font-Bold="True" ForeColor="#FFFFFF" HorizontalAlign="Right" />
                        </asp:GridView>   
                        </ContentTemplate></asp:UpdatePanel>

Click Here to view ASPX.CS file code

Most Searched Topics on Google

The most searched topics also includes to earn money or get the information from internet.
Lot of people search about: -
How to earn money from Internet

-Online work

-Work from Home

-Google Adsense and Adwords

-How to increase website ranking

-Job Search

-Automobile

-Health Tips,and Caring Methods etc.

-Baby Names, parenting

-Beauty tips

-Shares Market, Stock Exchange, Forex Trade & Business deals

-Mobile Tips, Mobile applications, Web Hacks Methods

-Game, Free Software & Crack Downloads

-Schools, Colleges, Exams, Online tuition, Scholarships

-Songs, Free Download Songs, Movies

-SMS, Send Free SMS in  India

Tuesday, May 21, 2013

How could Arabica Coffee be extinct by 2080?


Coffee In the News
Researchers: Climate Change Could Make Arabica Coffee Extinct By 2080

      Arabica coffee, which accounts for more than 70% of the world's coffee could fall victim to climate change and be extinct by 2080, according to a new study. Researchers at England's Kew Royal Botanic Gardens and Ethiopia's Environment and Coffee Forest Forum used computer modeling to predict how rising global temperatures and subtle changes in seasonal conditions might make some land unsuitable for Arabica plants, which are vulnerable to temperature change.
The best-case scenario predicts that 65% of locations where Arabica coffee is currently grown will become unsuitable by 2080, the study found. The most extreme model puts the loss at between 90% and 100%.
     In the Boma Plateau in south Sudan, among other areas, the demise could come as early as 2020, based on the low flowering rate and poor health of current crops. "Arabica can only exist in a very specific place with a very specific number of other variables," said Aaron Davis, head of coffee research at the Royal Botanic Gardens. "It is mainly temperature but also the relationship between temperature and seasonality -- the average temperature during the wet season for example."
     The study's authors said the dire predictions are conservative because they do not take into account the large-scale deforestation of the Arabia-suitable highland forests of Ethiopia and south Sudan. Pests, disease and other factors were also not considered. The researchers said certain "core sites" capable of yielding Arabia until at least 2080 should be set aside for conservation. Among them is the Yayu Coffee Forest in Ethiopia. Growers of domesticated coffee could still produce crops by watering and artificially cooling them, but wild coffee has much greater genetic diversity that is essential to help plantations overcome threats like pests and disease, according to the researchers.
     The study's authors said identifying new locations where Arabia could be grown away from its natural habitat in the mountains of Ethiopia and south Sudan could be the only way of preventing the demise of the species. Even if the beans do not disappear completely from the wild, climate change is highly likely to impact on yields and the taste of coffee beans in future decades, they added.

Source: Emily Jed -The Vending Time- Issue Date: Vol. 52, No. 12, December 2012, Posted On: 11/14/2012 

Always Free Shipping and "Bill Me Later" option
Remember, if you are an existing monthly customer or thinking about signing up for a monthly service, you will always receive free shipping on any product you order on our website!  
Additionally,  monthly customers will be able to use our exclusive "Bill Me Later" option which allows you to bypass the credit card payment and simply get billed later!



About Us
Interested in learning more about the benefits of coffee and our services? 
Visit our website at 
 Like us on Facebook

How much do you spend for coffee?


Coffee in the News
Americans Spend An Average $3,000 A Year On Coffee And Lunch At Work

JACKSONVILLE, Fla., Jan. 30, 2012 /PRNewswire/ -- American workers spend an alarmingly high amount of their hard earned cash on somewhat average daily expenses, according to a new Workonomix survey by Accounting Principals, a finance and accounting staffing firm. The survey found that 50% of the American workforce spends approximately $1,000 a year on coffee, or a weekly coffee habit of more than $20. And the spending doesn't stop there. Two-thirds (66%) of working Americans buy their lunch instead of packing it, costing them an average of $37 a week -- nearly $2,000 a year.
     Despite these high costs, the survey suggests workers are unclear about the biggest drain to their wallet. When asked which work expense they most want to be reimbursed for by their employer, 42% of employees chose commuting costs and only 11% chose lunch expenses. However, the average American's commuting cost is $123 a month, or approximately $1,500 a year, which is well below the average annual lunch tab of $2,000.
     "Small -- but consistent -- expenses add up quickly over time, and it can be difficult for consumers to realize it because they're only spending a few dollars at a time. But, as this survey shows, those few dollars can quickly turn into a few thousand dollars," said Jodi Chavez, senior vice-president at Accounting Principals.
     "Additionally, when you look at it over a worker's lifetime, that number grows exponentially. Consider the average American who works for about 40 years, starting their first job around age 22," Chavez said. "By the time they retire at age 62 they would have spent at minimum $120,000 on coffee and lunch, not including inflation."
     This is especially true for young American workers. The survey found that younger professionals (ages 18-34) spend almost twice as much on coffee during the week than those ages 45+ ($24.74 vs. $14.15, respectively). They also shell out more for lunch, spending an average of $44.78 a week on lunch compared to their older colleagues who spend $31.80 per week.
However, it seems American workers of all ages are starting to realize the effect this incremental spending has on their personal bottom line. According to Accounting Principals' survey, one-third (35%) of employees have made it a financial goal to bring lunch instead of buying it in 2012.

Source: Accounting Principals | Released Jan. 30, 2012


GO GREEN!
 The only 
waste products produced by our GREEN super-automatic espresso equipment is used coffee grounds and water. No spent cartridges clogging land fills! 
Keep checking our website by clicking the
 tab as we will soon be carrying a complete line of Eco friendly products including cups, plates, and tableware.
About Us
Interested in learning more about the benefits of coffee and our services? 
Visit our website at 
  
 Like us on Facebook

What are people saying about Effortless Espresso?

Looking for a great coffee service? Check out what people are saying about Effortless Espresso!
Great Varity and Convenience!

Beverage Solutions provides our office with two Effortless Espresso machines, maintenance services and all the coffee supplies we need. All the products are excellent and we are very happy with the service and the quality of the beverages. Our employees appreciate how easy it is to get an excellent, fresh cup of coffee any time they want, and with 8 different beverages to choose from there is something for everyone. I would definitely recommend Beverage Solutions to other businesses.

Bernie M., Weil, Gotshal & Manages LLP, Miami
Just what the doctor ordered!
  
"For several years, we've had two Beverage Solution's machines - one in each of our two doctor's lounges. The doctors love the product - so do I. So does everyone else! Espresso, cappuccino, coffee ... it's all great and very convenient. As for service, the company has always been very responsive - whenever there's a problem or we need something, they take care of it right away."

Luis F., Coral Gables Hospital, Coral Gables

Fun Facts About Coffee!
  • If you like your espresso coffee sweet, you should use granulated sugar, which dissolves more quickly, rather than sugar cubes; real sugar rather than artificial sweeteners which alter the taste of the coffee.
  • The word "coffee" was at one time a term for wine, but was later used to describe a black drink made from berries of the coffee tree. This black drink replaced wine in many religious ceremonies because it kept the Mohammedans awake and alert during their nightly prayers, so they honored it with the name they had originally given to wine. 
  • "Cowboy coffee"? It was said they made their coffee by putting ground coffee into a clean sock and immerse it in cold water and heated over campfire. When ready, they would pour the coffee into tin cups and drink it.  
Want to learn more about our products and services? Visit us at
. We provide Effortless Espresso machines, to water coolers, to a lot of your break-room needs! With us, great coffee has never been so easy!
Like us on Facebook
 

What's the science behind coffee's benefits?


The Science Behind Coffee and Why It's Actually Good For Your Health
 Kris Gunnars- Lifehacker- 2/25/13

Coffee isn't just warm and energizing, it may also be extremely good for you. In recent years, scientists have studied the effects of coffee on various aspects of health and their results have been nothing short of amazing.
Here's why coffee may actually be one of the healthiest beverages on the planet. 


Coffee Can Make You Smarter
Coffee doesn't just keep you awake, it may literally make you smarter as well. The active ingredient in coffee is caffeine, which is a stimulant and the most commonly consumed psychoactive substance in the world. Caffeine's primary mechanism in the brain is blocking the effects of an inhibitory neurotransmitter called Adenosine. By blocking the inhibitory effects of Adenosine, caffeine actually increases neuronal firing in the brain and the release of other neurotransmitters like dopamine and norepinephrine. Many controlled trials have examined the effects of caffeine on the brain, demonstrating that caffeine can improve mood, reaction time, memory, vigilance and general cognitive function.
Bottom Line: Caffeine potently blocks an inhibitory neurotransmitter in the brain, leading to a net stimulant effect. Controlled trials show that caffeine improves both mood and brain function. 


Coffee Can Help You Burn Fat and Improves Physical Performance
There's a good reason why you will find caffeine in most commercial fat burning supplements. Caffeine, partly due to its stimulant effect on the central nervous system, both raises metabolism and increases the oxidation of fatty acids. Caffeine can also improve athletic performance by several mechanisms, including by mobilizing fatty acids from the fat tissues. In two separate meta-analyses, caffeine was found to increase exercise performance by 11-12% on average.
Bottom Line: 
Caffeine raises the metabolic rate and helps to mobilize fatty acids from the fat tissues. It can also enhance physical performance. 


Coffee May be Extremely Good For Your Liver
The liver is a remarkable organ that carries out hundreds of vital functions in the body. It is very vulnerable to modern insults such as excess consumption of alcohol and fructose. Cirrhosis is the end stage of liver damage caused by diseases like alcoholism and hepatitis, where liver tissue has been largely replaced by scar tissue. Multiple studies have shown that coffee can lower the risk of cirrhosis by as much as 80%, the strongest effect for those who drank 4 or more cups per day . Coffee may also lower the risk of liver cancer by around 40% .
Bottom Line: Coffee appears to be protective against certain liver disorders, lowering the risk of liver cancer by 40% and cirrhosis by as much as 80%. 


Coffee is Loaded With Nutrients and Antioxidants
Coffee isn't just black water. Many of the nutrients in the coffee beans do make it into the final drink, which actually contains a decent amount of vitamins and minerals.
A cup of coffee contains :
  • 6% of the RDA for Pantothenic Acid (Vitamin B5).
  • 11% of the RDA for Riboflavin (Vitamin B2).
  • 2% of the RDA for Niacin (B3) and Thiamine (B1).
  • 3% of the RDA for Potassium and Manganese.
May not seem like much, but if you drink several cups of coffee per day then this quickly adds up. But this isn't all. Coffee also contains a massive amount of antioxidants. In fact, coffee is the biggest source of antioxidants in the western diet, outranking both fruits and vegetables combined.
Bottom Line:Coffee contains a decent amount of several vitamins and minerals. It is also the biggest source of antioxidants in the modern diet. 

This Month's Featured Products 
Free Local Delivery
Fanta Orange Soda

Martinelli Apple Juice


Red Bull Can


Interested in learning more about our products and services? 
Visit our website at 

Like us on Facebook

What's the science behind coffee's benefits? Pt 2



The Science Behind Coffee and Why It's Actually Good For Your Health-Part 2
 Kris Gunnars- Lifehacker- 2/25/13


Coffee May Drastically Lower Your Risk of Type II Diabetes
Type II diabetes is a lifestyle-related disease that has reached epidemic proportions, having increased 10-fold in a few decades and now afflicting about 300 million people. This disease is characterized by high blood glucose levels due to insulin resistance or an inability to produce insulin. In observational studies, coffee has been repeatedly associated with a lower risk of diabetes. The reduction in risk ranges from 23% all the way up to 67%. A massive review article looked at 18 studies with a total of 457,922 participants. Each additional cup of coffee per day lowered the risk of diabetes by 7%. The more coffee people drank, the lower their risk.
Bottom Line: Drinking coffee is associated with a drastically reduced risk of type II diabetes. People who drink several cups per day are the least likely to become diabetic.


Coffee May Lower Your Risk of Alzheimer's and Parkinson's
Not only can coffee make you smarter in the short term, it may also protect your brain in old age. Alzheimer's disease is the most common neurodegenerative disorder in the world and a leading cause of dementia. In prospective studies, coffee drinkers have up to a 60% lower risk of Alzheimer's and dementia. Parkinson's is the second most common neurodegenerative disorder, characterized by death of dopamine-generating neurons in the brain. Coffee may lower the risk of Parkinson's by 32-60%.
Bottom Line: Coffee is associated with a much lower risk of dementia and the neurodegenerative disorders Alzheimer's and Parkinson's.



Coffee May Decrease Your Risk of Dying
Many people still seem to think that coffee is unhealthy. This isn't surprising though, since it is very common for conventional wisdom to be at exact odds with what the actual studies say. In two very large prospective epidemiological studies, drinking coffee was associated with a lower risk of death by all causes. This effect is particularly profound in type II diabetics, one study showing that coffee drinkers had a 30% lower risk of death during a 20 year period.
Bottom Line: Coffee consumption has been associated with a lower risk of death in prospective epidemiological studies, especially in type II diabetics.


Take Home Message
Even though coffee in moderate amounts is good for you, drinking way too much of it can still be harmful. I'd also like to point out that many of the studies above were epidemiological in nature. Such studies can only show association, they can not prove that coffee caused the effects. To make sure to preserve the health benefits, don't put sugar or anything nasty in your coffee! If it tends to affect your sleep, then don't drink it after 2pm. At the end of the day, it does seem quite clear that coffee is NOT the villain it was made out to be. If anything, coffee may literally be the healthiest beverage on the planet.


This Month's Featured Products 
Free Local Delivery
Fanta Orange Soda

Martinelli Apple Juice


Red Bull Can


Interested in learning more about our products and services? 
Visit our website at 

Like us on Facebook