Posts

Showing posts from September, 2013

Featured Post

Smart Product designer

Image
download and purchase link: https://alkanyx.com/item/49/Smart+Product+designer

Live preview : http://smartproductdesigner.000webhostapp.com/

Smart Product Designer is a  tool to create your own product and get directly from your website. It is well documented, very easy to customize and use. It is build using most advance technologies including javascript, jQuery and html5.
Features Choose different product from collectionAdd custom texts to product.Change text colorChange the size and font of the TextLet the user drag, move or remove elementsAdd images to product selected from art gallery or browse it from systemDesign both frontside and back-sideShows preview while designingDownload designVery easy to customize and useHere is the purchase link : https://alkanyx.com/item/49/Smart+Product+designer

.NET Interview questions ( around 2 Years experience)

What are assemblies?What is the process to create shared assembly?Difference between abstract class and interface?What is multilevel inheritance?What are the steps to fetch data from a database table?We have 5 classes created in .NET. As per one of the customer requirement we need to change the  implementation of the function. How can we do that without changing existing class structure?What is the difference between managed and unmanaged code?What is the difference between httpmodules and httphandlers?What is operator overloading?Difference between DataList and Hashtable?Difference between Hashtable and Dictionary?
I will update this post with the answers of above questions.

Display images using Datalist in ASP.NET C#

A Datalist control can be used to display images. We can bind the data from database to datalist. Here is the code to display images using datalist.

Page source:
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal">             <ItemTemplate >                 <asp:Image ID="imglst" runat="server" ImageUrl ='<%#Eval("image")%>' Width="70" Height="50" />             </ItemTemplate>  </asp:DataList>
C# code:  protected void Page_Load(object sender, EventArgs e)         {             DataSet ds = new DataSet();             string strcon = ConfigurationManager.ConnectionStrings["con"].ConnectionString;             SqlConnection conn = new SqlConnection(strcon);             conn.Open();             SqlCommand cmd = new SqlCommand("SELECT image from Image", conn);             SqlDataAdapter adpt = new SqlDataAdapter(cmd);             conn.Close…

Storing Image url in MS Sql database

Image
For fast loading of images we can store the location of the image rather than the storing the image itself. Following can be used to store image url in the database -



protected void Button1_Click(object sender, EventArgs e)         {             if (FileUpload1.HasFile)             {                 string imagepath = "~/images/" + FileUpload1.PostedFile.FileName;                 string strcon = ConfigurationManager.ConnectionStrings["con"].ConnectionString;                 SqlConnection conn = new SqlConnection(strcon);                 conn.Open();                 SqlCommand cmd = new SqlCommand("INSERT into Image (name, image) VALUES (@name, @image)", conn);                 cmd.Parameters.AddWithValue("@name", FileUpload1.PostedFile.FileName);                 cmd.Parameters.AddWithValue("@image", imagepath);                 cmd.ExecuteNonQuery();                 conn.Close();
            }         }