.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# P/Invoke DhcpRequestParams returns always error 87

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :.NET Framework
Hi, I want to retrieve specific DHCP parameters through the DhcpRequestParams api method from c#. I tried different ways of calling the method but i always get error code 87 (= invalid parameter). At the moment i am stuck at those error because i don't know what i am doing wrong. Please can you help me telling which parameter is invalid or if the allocation of pointers are not correct?   My code attached:   public class ClDHCPApiCalls { public struct DHCPCAPI_CLASSID { public UInt32 Flags; public IntPtr Data; public UInt32 nBytesData; } public struct DHCPCAPI_PARAMS { public UInt32 Flags; public UInt32 OptionId; [MarshalAs(UnmanagedType.Bool)] public bool IsVendor; public IntPtr Data; public UInt32 nBytesData; } public struct DHCPCAPI_PARAMS_ARRAY { public UInt32 nParams; public IntPtr Params; } [DllImport("Dhcpcsvc.dll", CharSet = CharSet.Unicode)] public static extern uint DhcpRequestParams(uint Flags, IntPtr Reserved, string AdapterName, DHCPCAPI_CLASSID ClassId, DHCPCAPI_PARAMS_ARRAY SendParams, DHCPCAPI_PARAMS_ARRAY RecdParams, IntPtr Buffer, ref uint pSize, string RequestIdStr); public static void RequestData() { DHCPCAPI_PARAMS scRecvdParams = new DHCPCAPI_PARAMS(); scRecvdParams.Flags = 0

View Complete Post

More Related Resource Links

Resume SharePoint Services Web Application and returns code 1387 error


Hello everyone! Newbie here. I would like to ask how to start the SharePoint Services Web Application on (WSS3.0,internal database, stanalone users) without getting error 1387 ?

I would love to provide more information regarding this issue but what I got is error 1387 displayed in the browser.

I look forward to seeing you guys feedback from your expertise angle.



AdomdDataAdapter.Fill returns memory error when querying an SSAS Cube(2008)

For certain SQL's I will get the following error when calling the Fill method on an AdomdDataAdapter object. "Memory error: While attempting to store a string, a string was found that was larger than the page size selected. The operation cannot be completed."   Snippet of Code: DataSet ds1 = new DataSet(); AdomdCommand acmd1 = cn1.CreateCommand(); acmd1.CommandText = "SELECT ..."; AdomdDataAdapter ad1 = new AdomdDataAdapter(acmd1); ad1.Fill(ds1);   Now when we run this query in Ms Sql Studio we don't get any errors but the query returns 1 row with over 40,000 columns. I'm guessing the # of columns might be an issue but not sure.   When doing a Google search it appears that this problem was found in the 2005 and fixed in that version. Have any of you come across this problem?  

Microsoft.SharePoint.Client.File.OpenBinaryDirect - returns a 404 error if the file being requested

Hopefully someone can help with this. I'm using Sharepoint 2010. On the server I have manually created a folder in the "Shared Documents" folder called "bin" and uploaded a file into this folder If I attempt to access the files in this folder using the Microsoft.SharePoint.Client.File.OpenBinaryDirect function,  I receive the following error: A first chance exception of type 'System.Net.WebException' occurred in System.dll: System.Net.WebException: The remote server returned an error: (404) Not Found.    at System.Net.HttpWebRequest.GetResponse()    at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()    at Microsoft.SharePoint.Client.File.OpenBinaryDirect(ClientContext context, String serverRelativeUrl). Any other files in any other folders under the shared documents folder are accessible. Here is my example code: ClientContext clientCTX = new ClientContext(SPURL);             //Pass the credentials to the client context             clientCTX.Credentials = credentials;             List DeployFilesList = clientCTX.Web.Lists.GetByTitle("Shared Documents");             CamlQuery caml

Analysis Services - Query returns a #error result

Hi, I have a cube - which i had backed up and just retored it. After the restoration, when i try to reply the cube e.g: select [Time].&[200503] on 0 , {[Process].[All process]} on 1 from [myConsolidations] - i recieve an a result showing #error only. What could be the cause of this?

SSIS Package returns the error - The command execution generated errors.

SSIS Package returns the error - 'The command execution generated errors'. Please let us know the cause for this error if anyone encountered this error before. Require a solution for this.   Thanks

Linked Server To MS Access using Jet Returns "unspecified error"

I'm have SQL SERVER 2008 on Win2008 Server. I have several linked servers to Oracle (odbc) and have just created Linked Servers to MS access 2003 databases on network shares. I can 'test connection' and select data from the linked ms access servers using 4 part naming no problem. As soon as I do this, the Oracle db links stop working. I reboot the server, test connection to Oracle dbs , all ok there, run test connection to ms access dbs and receive the following;Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "MYAccessLink"".OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "MYAccessLink" returned message "Unspecified error". (Microsoft SQL Server, Error: 7303) Reboot the server, test connection to ms access db's, all ok, then test connection to oracle, and receive the following;A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.) (Microsoft SQL Server, Error: 109) Reboot server, perform test again, toggling the order and I get the same results.Have tried opening ms access via openrowset and "execute ('select count(*) from SomeTable') at MYAccessLink" to rule out test connection (sp_testlinkedserver) doing something to crash the links. I have checke

statement with SQL_C_WCHAR returns 22001 string data, right truncation error

I am trying to execute the following code  value = L"Test13Digit++"; SQLPrepare(stmt, L"delete Entries where [type] = ?", SQL_NTS); SQLBindParameter(stmt, paramNumber, SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_WVARCHAR, 100, 0, (SQLPOINTER) value.c_str(), 0, &strLen); SQLExecute(stmt); the table entries is as follows: Entries ([type] nvarchar(100), [key] nvarchar(100), [version] bigint, [data] varbinary(8000), CONSTRAINT PK_Entries PRIMARY KEY([type], [key]))   I keep getting the 22001 - string data, right truncation error. I have tried all different versions of WCHAR types but does not seem to help.

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

asp.net forms authentication with route handling - error, routes not recognized, returns to login


 I just created a small site with form authentication with route handling.  Without forms authentication, the pages route just fine.  With forms, it returns back to the login page as it is not one of my allowed locations specified in my web.config file.


I know I probably need to write a custom route handler.  Does anyone have an example I can follow for this?  Thanks.

Named Set and Calculated Measure returns #Error values


I'm trying to create a set of measures that will give me a count of how many customer have bought a product that falls in to different levels in a heirarchy (Department -> Category )

I have a fact table that contains OrderDetail records at the SKU level.

My Product dimension contains the hierarchy assoicated to each SKU

My 3 measures are

Measure 1 -  number of items >= 1 and <= 3

Measure 2 - number of items >=4 and <=7

MEasure 3 - number of items >= 8

I have created a names set to cross join all the members in the product hierarchy with the customers





SQL Server user-defined aggregate returns an error if aggregating 0 rows

I have this SQL Server user-defined aggregate:

[SqlUserDefinedAggregate(Format.UserDefined, Name="median", IsInvariantToDuplicates=false, IsInvariantToNulls=true, IsInvariantToOrder=true, IsNullIfEmpty=true, MaxByteSize=8000)] 
public class MedianCalculator : IBinarySerialize { 
    private List<double> values; 
    public void Init() { 
        values = new List<double>(); 
    public void Accumulate(SqlDouble value) { 
        if (!value.IsNull) 
    public void Merge(MedianCalculator other) { 
    public SqlDouble Terminate() { 
        if (values == null || values.Count == 0) 
            return SqlDouble.Null; 
        return (values[(int)Math.Floor((values.Count - 1) / 2.0)] + values[(int)Math.Ceiling((values.Count - 1) / 2.0)]) / 2.0; 
    public void Read(BinaryReader r) { 
        int c = r.ReadInt32(); 
        values = new List<double>(c); 
        for (int i = 0; i < c; i++) 
    public void Write(BinaryWriter w) { 
        for (int i = 0; i < values.Count; i++) 
After deploying this aggregate, I try to run this query:

Simple Ajax returns 200 OK but fires error

Hi, I'm doing a simple ajax example but for some reason it keeps fireing 'error' yet the status returned is 200. Any reasons 'success' is not fired with the simple message? Do I need to reference the json library or is this included with jquery?  

Default.aspx :
<script type="text/javascript" src="scripts/jquery-1.4.3.min.js"></script>  
<script type="text/javascript">      
      function getMessage()
              type: "POST",              
              url: "Default.aspx/sayHello",
              contentType: "application/json; charset=utf-8",
              data: "{}",              
              dataType: "json",
              success: function(response)              
              error: function(response)              
<title>Calling a page method with jQuery</title>  
    <form id="form1" runat="server">                      
        <input type="button" value="get message" onclick="getMess

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

Webservice versions.asmx: Getversions-method returns error on an item of a custom list.


I using GetVersions from the webservice http://server/_vti_bin/versions.asmx. This method works Okay in SharePoint 2007, and in SharePoint 2010 it also works Okay on documents from a document library. But when I used on an item from a custom list, it returns an error stating: "Value cannot be null.\r\nParameter name: key". In SharePoint 2007 I could retrieve the histroy on an item with the call GetVersions("Lists/MyCustomList/5_.000"), in SharePoint 2010 this fails.

Do I need to change the parameter, or use another filename for an item instead of "5_.000"? Does any one have the same experience?

Thank you

AddPermissionCollection returns error: Value does not fall within the expected range



I'm trying to add permissions to a new subsite by getting the permissions from an existing one using the following method from the _vti_bin/Permissions.asmx webservice:

    XmlNode xnode = spPermissionsWS.GetPermissionCollection("http://SharePointServer/MyNewSite", "Web");

    spPermissionsWS.AddPermissionCollection(http://SharePointServer/MyNewSite, "Web", xno

partial page returns an error, the same code on a full page doesn't


i have after a lot of help and some major frustrations, finally got my database returning data. i am using a .edmx file to hold most of the database information and some additional model classes (for instance particular queries joining 2 tables)

i have a model


namespace iliteratimvc.Models
    public class TitleModel
        public string MsTitle { get; set; }
        public string MsDescription { get; set; }
        public DateTime MsUploaded { get; set; }
        public int Status { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }

and controller code


public ActionResult RecentMSS()
            var rmss = (from m in ilitAuth.Manuscripts
                        join a in ilitAuth.AuthorDetails on m.MsAuthor equals a.UsID
                       where m.Status == 1
                       orderby m.MsUploaded descending
                        select new TitleModel
                            MsTitle = m.MsTitle,
                            MsDescription = m.MsDescription,
                            FirstName = a.FirstName,
                            LastName = a.LastName
            var rmssList = rmss.ToList();


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