locked
using user controls from another project problem RRS feed

  • Question

  • hi
    assume that I have an application which have 3 projects inside a solution.
    in one of them I have a user control with a tree view which get the data from the other project and fill the treeview.
    now I want to use the user control in third project. when I try to add the user control by the code it works greate but if I drag it to the form I will get SQL exception error on designer view.if i remove the sql part of code in user control and then add the user control to the form it will add without problem. then if I add sql part  it still work when I run the application but I am not able to see my designer any more before removing the other part. I really can not undrestand what can be the problem and how to solve it. it is the design of my application to have several layers and I really don't want to make a mess on the design.
    thank you in advance
    Thursday, July 17, 2008 8:19 AM

Answers

  • Hi,

    I think you have some code which is running when you initialize the control. might trying to access the database and some information are missing like the connectionstring or something else.

    Can you plesae paste the code which you have cut and after that it's work ?
    Nayan Paregi | Microsoft Certified Technology Specialist (MCTS)
    • Marked as answer by jack 321 Monday, July 21, 2008 5:46 AM
    Thursday, July 17, 2008 2:00 PM

All replies

  • Hi,

    I think you have some code which is running when you initialize the control. might trying to access the database and some information are missing like the connectionstring or something else.

    Can you plesae paste the code which you have cut and after that it's work ?
    Nayan Paregi | Microsoft Certified Technology Specialist (MCTS)
    • Marked as answer by jack 321 Monday, July 21, 2008 5:46 AM
    Thursday, July 17, 2008 2:00 PM
  • thank you for the reply.
     Yes! you are true because the connection string will come from application config file. so the application is not aware about it
    Monday, July 21, 2008 7:02 AM