Search This Blog

Friday, June 19, 2009

Assembly Error

Error 4 The type 'ASP.aspx_controls_maintop_ascx' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\online_store\7e5e2cc2\6d0e9d9d\App_Web_iv00njwa.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\online_store\7e5e2cc2\6d0e9d9d\App_Web_ndsosjuw.dll' D:\Projects\Online_Store\aspx\Confirm.aspx

If you get error like this that 2 assemblies exists in same path then go to the specified path 
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
and delete ur project.
Because this is all temporary files and restart ur visual studio.

How to give image url at runtime in any databound controls of asp.net

Take a image tag in ur databound control like gridview,datalist.
If you take asp image tag then set path like bellow
ImageURL = ImageTest(DataBinder.Eval(Container.DataItem, "sLogo") in asp tags.

Here ImageTest is a function in which you can give your imageurl. For example view the following :- 
 protected object ImageTest(object s)
    {
      object path = "~/aspx/productimages/" + Session["Member"] + "\\logo\\" + s;
      return path;
    }

set ur image url in path object variable.

Thank you

Wednesday, June 17, 2009

SQL Tool Belt

Now you can compare your database , copy or get documentation in which you will be able to get your store procedures, tables, views and many more things.

just refer the following sites : -

https://www.red-gate.com/dynamic/downloads/downloadform.aspx?downloadid=831500&password=FUVUDTYYQB&step=3

Tuesday, June 16, 2009

Modify XML Data at runtime

view the following link this will help you.

http://support.microsoft.com/kb/317666
Also refer this : -

 protected void fillXml()
    {
        DataSet dsbanner = new DataSet();
        dsbanner = bsadv.getBannerStore();
        string s = Server.MapPath("../aspx/aspxBanner.xml");
        dsbanner.WriteXml(s);
        xml();      
    }
    public void xml()
    {
        try
        {
            // Create an XML document instance, and load XML data.
            XmlDocument doc = new XmlDocument();
            string s = Server.MapPath("~/aspx/aspxBanner.xml");
            doc.Load(s);
            XmlNode nodelist = doc.DocumentElement;
            foreach (XmlNode node in nodelist.ChildNodes)
            {
                foreach(XmlNode node1 in node.ChildNodes)
                {
                    if(node1.Name == "sBannerImageName")
                        node1.InnerText = "../admin/banner/" + node1.InnerText;
                }
            }
            doc.PreserveWhitespace = true;
            XmlTextWriter wrtr = new XmlTextWriter(s, Encoding.Unicode);
            doc.WriteTo(wrtr);
            wrtr.Close();
        }
        catch (Exception ee)
        {
        }
   }

Metadata Error

Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\myweb\8c7cf79c\37f396b\App_Web_4a6-li_x.dll' could not be found  

If you got error like this then go to this perticular directory and search the file without extension and you will get the same file with extension .delete change it and rename it with .dll.
Your problem will be solved.