.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

C++ Q&A: Why = Returns a Reference, Accessing the Recycle Bin, When to Use STL

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Error accessing Search Settings and search returns 0 results

Quick summary - my MOSS 2007 server died. I brought up a new server, installed MOSS, service pack 1, service pack 2, created the new config database, then attached my existing content database (I have a separate physical server for the databases). After a few tweaks to get most of the other settings back in order, (most) everything seems to be working somewhat as it should except for Search. Whenever I try to access Search settings I get an error: "An error occurred during the processing of . The resource object with key 'S2SearchAdminDashboard_Title' was not found". I created a new SSP with it's own unique account for the service and app pool (read online that it should be different than SharePoint account because of the timer service conflicting with search), I tried copying the files (listed here: http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/1a93ef86-be5a-44ad-a814-14613fd0a78f) from my test environment with no luck, I've made sure the permissions to the Task Scheduler were correct (found a Google blip about that somewhere), I've deleted and re-installed the SSP multiple times, ran the Configuration Wizard more times than I can count, but no matter what I do it never changes and always gives the same error. Also, whenever I try to access Central Admin it tries redirecting me to http://servername:portnumber/_admin/SearchServerW

Accessing response of HttpWebRequest, even when request returns 500 Internal Server Error



Hoping someone can point me to a solution, haven't been able to find one yet.

I'm using the standard way for send HttpWebRequest

		webRequest = (HttpWebRequest)WebRequest.Create(request.URL);
webRequest.Method = "POST";
webRequest.ContentType = "text/xml";


postStream = webRequest.GetRequestStream();
postStream.Write(requestBuffer, 0, requestBuffer.Length);
webResponse = (HttpWebResponse)webRequest.GetResponse();
responseStream = webResponse.GetResponseStream();
responseReader = new StreamReader(responseStream);
string response = responseReader.ReadToEnd();

This is all fine, working correctly, no poblems.

However the actual webservice that i'm calling returns a 500 Internal Server Error code for standard faults

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=utf-8
Content-Length: 703
Date: Fri, 22 Oct 2010 04:50:48 GMT

<?xml version="1.0" en
coding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.o

object reference not set to instance of an object - list has returns in Controller but nothing in th


I started talking about this issue in an other thread i posted which was originally about another error, so i figure i may get more response posting it as a new thread.

i am trying to get some information from my remote sql server and return it to a list on a strongly-typed view. i have used a .edmx file to map the database rather than writing individual model classes because I have a pre-existing, multi-tabled database.

on the controller, i have created an entity variable this way

iliteratimvc.Models.iliteratiEntities ilitAuth = new iliteratimvc.Models.iliteratiEntities();

and the controller code for returning the view is:

public ActionResult RecentMSS()
            var rmss = (from m in ilitAuth.Manuscripts select new { m.MsTitle, m.MsDescription });
            var rmssList = rmss.ToList();
            return View(rmssList);

the view code is:

@model IEnumerable<iliteratimvc.Models.Manuscript>


@foreach (var m in Model)
    <li>@m.MsTitle, @m.MsDescription </li>

However, this returns an "Object Reference not set to an instance of an Object" error. The error occurs on the "@foreach" code on the view. Acting on advice I got on the other thread (thanks for y

A better way to reference your wizard steps using named steps

Note: this article uses the plain vanilla but the concepts apply equally well to its popular counterpart .

By far the most common way that I see wizard steps reference in code snippets is by their index.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Accessing SharePoint 2010 Data with Server-Side APIs

Accessing SharePoint data in server-side solutions is one of the most common tasks that you will perform as a SharePoint developer. SharePoint 2010 provides powerful server-side APIs that enable you to retrieve, add, edit, and delete SharePoint data programmatically. SharePoint 2010 also includes the new LINQ to SharePoint technology that enables you to work with SharePoint data efficiently and easily.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

reference from menubuttons to text parts in article on the same page


Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.


Reference HttpApplication from a separate HttpApplication


I want to create a website that can monitor the status of other websites running on the same server. Is this possible? How do I get a reference to a site's HttpApplication context from a separate HttpApplication?

Registering controls of current assembly object reference NOT set error


Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?


Problem in accessing resource file dynamically.


Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

Accessing Functions from a Class



I am a PHP developer and am running into a lot of issues with C# and .NET. I would like to be able to do the following in C#. (i'm not sure if it should be done this way though)

C# File:

using System;
using System.Data.Odbc;
using System.Data;
using System.Configuration;

partial class site_functions : System.Web.UI.Page

protected void Main(object sender, EventArgs e)

public static void open_database()
OdbcConnection myConn;
OdbcDataReader MyReader = null;
string strConnection = ConfigurationSettings.AppSettings["dbConnect"];

myConn = new OdbcConnection(strConnection);

public void close_database()

public void Read_Database()
//do something


<%@ Page Language="C#" CodeFile="site-functions.cs" Inherits="site_functions" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

Office Add-Ins: 3 Solutions for Accessing SharePoint Data in Office 2010


SharePoint 2010 introduces a number of new ways to access business data and present it to the user. We'll show you several options that range from no-code solutions to fully integrated Office add-ins.

Donovan Follette , Paul Stubbs

MSDN Magazine July 2010

Data Points: Accessing Data from a Mobile Application


This month John Papa takes a look at developing a mobile application that can access data on your application server.

John Papa

MSDN Magazine January 2008

SharePoint: Add a Recycle Bin to Windows SharePoint Services for Easy Document Recovery


Windows SharePoint Services helps improve collaboration and workflow while protecting documents and intellectual property. But one feature is conspicuously missing - an easy way to back up and restore deleted files from document libraries. In this article, the authors take advantage of the extensibility of WSS and its server-side and client-side object models to build a restore feature that works like the Recycle Bin in Windows Explorer.

Maxim V. Karpov and Eric Schoonover

MSDN Magazine February 2005

House of Web Services: Accessing Raw SOAP Messages in ASP.NET Web Services


Web Services exchange XML messages. Most of today's Web Service toolkits do their best to hide this fact from developers, by exposing a Web Service's behavior as method invocations against objects instead.

Tim Ewald

MSDN Magazine March 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend