Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Error, when tried to deploy a gridview web part

  Asked By: Prince    Date: Aug 27    Category: Sharepoint    Views: 1385

I Created a web part which pulls data from my local database, it is working fine
from my local application.
But getting the following error when deployed into sharepoint as a web part.
Can anyone help me!


From local database I am getting the data like this (some dummy data)


I used sqlconnection, sqlcommand, sqldataadapter, and dataset (completed code in
usercontrol.ascx.cs file) and loaded this user control in .cs file. What will be
the problem?. I even commented <authentication> tag in web.config file of
application.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Shashwat Takle     Answered On: Aug 27

Your attached screenshots didn't come through. Please load them
somewhere else and include a link or just print out the error  message
and we'll try to help.

 
Answer #2    Answered By: Aastha Acharya     Answered On: Aug 27

Can anyone help  me!
I Created a web  part which pulls  data from my local  database, it is working  fine
from my local application.
But getting the following error  when deployed  into sharepoint  as a web part.



From local database  I am getting the data  like this (some dummy data)


I used sqlconnection, sqlcommand, sqldataadapter, and dataset (completed code in
usercontrol.ascx.cs file) and loaded this user control in .cs file
//Get User Control Location protectedstringUserControlPath =
@"~/UserControls/";protectedstringUserControlFileName =
@"GetCustomerControl.ascx"; {protectedoverridevoidCreateChildControls() try
{
myCustomers = (
Controls.Add(myCustomers);
}
{
} UserControlmyCustomers =
newUserControl();UserControl)this.Page.LoadControl(UserControlPath +
UserControlFileName); catch(Exceptionex) throwex; finally {
}
} base.CreateChildControls();//Renders the content of the control to the
specified writer{
}protectedoverridevoidRenderContents(HtmlTextWriterwriter)
base.RenderContents(writer);

What will be the problem?. I even commented <authentication> tag in web.config
file of application.

 
Answer #3    Answered By: Glenda Roth     Answered On: Aug 27

Since you are using a User Control I assume you are also using inline
code in the user control. Normally SharePoint's Code Access Security
model doesn't allow the use of inline code. Try putting your user
control under the ControlTemplates directory of the 12 hive
(~/_controltemplates/...). This is where SharePoint stores most of its
user controls. This location will allow inline script to be run.

Also, please note that the screen shots of your error  messages are NOT
coming through. Please copy them to text rather than sending images.
Otherwise we are trying to help  without all the information.

 
Answer #4    Answered By: Jada Clemons     Answered On: Aug 27

Error: "Object referenct not set to an instance of an object".
I developed this web  part which is a gridview  which pulls  data and shows, which
is perfectly working  when i developed in my personal system where moss is not
installed. After building it, I deployed  it in MOSS server, then i got this
error.
Now, I copied that application  into MOSS server and build it there, and
deployed, dont know what happened, it's working now.
What would be the reason?

 
Answer #5    Answered By: Brooke Lewis     Answered On: Aug 27

Have you tried attaching to the w3wp process to debug? Did you add the
necessary SafeControl entries to your web.config? Were you building
against the same ASP.NET version in both environments?

 
Didn't find what you were looking for? Find more on Error, when tried to deploy a gridview web part Or get search suggestion and latest updates.




Tagged: