google

Newest Post

Unable to find the requested .Net Framework Data Provider. It may not be installed.

| Thursday, April 10, 2014
Read more »
Above error can be caused by if the "Provider" given in "SqlDataSource" or any other data source control is not updated.

This error can be resolved either by updating the Provider details in connection string property of web.config file or you simply remove the

 ProviderName="<%$ ConnectionStrings:DbConnectionString.ProviderName %>"  


from SqlDataSource control or any other data source control.

Convert byte[] array into base64 string in C#.NET or ASP.NET

| Wednesday, April 2, 2014
Read more »
Following is the code which can be used to convert an Image data from the SQL Server Database Image type column. SQL Server returns image column in the format of byte array i.e byte[].

  if (ds.Tables.Count > 0)  
       {  
         if (ds.Tables[0].Rows.Count > 0)  
         {  
           string MyImage = Convert.ToBase64String((byte[]) ds.Tables[0].Rows[0]["MySnap"]);  
          }  
       }  

We can retrieve the image column in DataSet or using the DataReader and then use Convert.ToBase64String() method to convert it into base64 string.

Above code can also be used for WCF service methods while sending data from database to mobile devices or some other purpose.

Convert byte[] array into base64 string in C#.NET or ASP.NET

Posted by : Stranger
Date :Wednesday, April 2, 2014
With 0comments
Next Prev
▲Top▲