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

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

PredictCaseLikelyHood returns 0, 1 or NaN

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hi, I have a clustering model which I want to use to detect anamolies in input data. However when I create DMX queries in the SSAS Mining Model Prediction Tab using the PredictCaseLikelyHood function, the function usually returns 0, 1 or NaN without any apparent correlation to the underlying data. As far as I can tell from the clusters, the underlying data is not particularly random. Any ideas to what could be causing this? Best regards Jørgen      

View Complete Post

More Related Resource Links

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.

sqldatasource's filter returns too few records


I have a puzzling issue.  This is in asp.net 2.0, using vb.  I have a gridview that is bound to a sqldatasource.  Here is the datasource code:

<asp:SqlDataSource ID="fellowsSqlDataSource" runat="server"
        ConnectionString="<%$ ConnectionStrings:PFPFellowsConnectionString %>"
        ProviderName="<%$ ConnectionStrings:PFPFellowsConnectionString.ProviderName %>"
        FilterExpression="{0}"  >
            <asp:SessionParameter Name="psuaccessid" SessionField="username" />         

Linq to SQL returns null for DateTime fields.


I have a linq to sql entity class in which I declared some DateTime fileds like this:

[Column(DbType = "smalldatetime")]
public DateTime? StartDate { get; set; }

And this is how I fetch data form repository:

return repository.Logs.OrderByDescending(l => l.LogID).FirstOrDefault();

All non DateTime fields are filled properly but all datetimes are null.

[Column(DbType = "smalldatetime")]

        public DateTime? StartDate { get; set; }

Adding carriage returns between 2 dynamically created controls in an HtmlTableCell


The title pretty much explains it. Here is what i'm trying to do...

 Private Sub LoadGrid_CommentsField(ByVal Row As HtmlTableRow, ByVal BookingNumber As String, ByVal CommentsText As String)
  Dim Txt As TextBox
  Dim Cmd As ClickOnceButton.ClickOnceButton

  Txt = New TextBox
  Txt.ID = "txtComment_" & BookingNumber
  Txt.CssClass = "TFAppControls"
  Txt.TextMode = TextBoxMode.MultiLine
  Txt.MaxLength = 500
  Txt.Width = New Unit(95, UnitType.Percentage)
  Txt.Text = CommentsText

  Row.Cells(cComments).InnerHtml &= "<br/>"

  Cmd = New ClickOnceButton.ClickOnceButton
  Cmd.DisableAfterClick = True
  Cmd.Text = "Save Comments"
  Cmd.ID = "cmdSaveComments_" & BookingNumber
  Cmd.CssClass = "TFAppButtons"
  Cmd.EnableViewState = False
 End Sub

On the line where i try and update the InnerHtml, i get the following error; "Cannot get inner content of  because the contents are not literal."

Picker returns nothing for BDC column in custom list


Playing with the BDC for the first time, running into some issues adding a Business Data column to a custom list.

I believe my ADF file is solid. I've been able to import that just fine and can use the application to drive various BDC-specific webparts (a Business Data List or Business Data Item, for example). It also seems to work when I manually enter information in my NewForm.aspx field and click the Check Names button (it verifies my entry and underlines it, creates link to profile when I view the list data).


If I try to use the picker, I get nothing. Enter a name I know is valid or a % and click the magnifying glass icon and I very briefly get the "Please Wait" message, then just an empty set with "Type into the search box above then press "Enter" to start your search" where my results should be.

Any pointers? Thanks.

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.



VS2005 calling VS2010 asmx service returns empty string


Anyone have any experience with this?

We are using VS 2005 for the front end, and vs 2010 for the web services part (asmx), not wcf yet.


Web service works just like the vs2005 when run locally, no problems.


Connecting to it from a test app returns an empty string. Connecting to a 2005 app doesn't!

Anyone run into this before or have a suggestion? Surely vs 2005 can connect to web services from a later version?






GlobalMemoryStatus returns negative junk value

Hi all,i am retrieving total physical memory using GlobalMemoryStatus() as follows :public struct MemoryStatus{public uint Length; //Length of struct public uint MemoryLoad; //Value from 0-100 represents memory usage public uint TotalPhysical;public uint AvailablePhysical;public uint TotalPageFile;public uint AvailablePageFile;public uint TotalVirtual;public uint AvailableVirtual;}MemoryStatus stat;[DllImport("kernel32.dll")]public static extern void GlobalMemoryStatus(out MemoryStatus stat);GlobalMemoryStatus(out stat);uint totPhy = stat.TotalPhysical;My question is 1) Is the stat.TotalPhysical return the actual physical memory installed int he machine ?2) I am getting neagtive value like -271691776 for the vista mahcine(Os type : 6.0.6001) and Windows Server 2000 . What is the reasonCan someone please help me out.Thanks in advance

Looking for TSQL statement that returns customers with greatest number of order in descending order

What would be an efficient TSQL SELECT statement that joins customer and order tables, counts the orders for each customer (group by) and returns a result for all customers with at least one order, and also in descending order from customers with the most orders to the least?

BuildManager.GetType returns null until application pool recycles

Our application uses the Enterprise Library's PropertyProxyValidator class to validate user input (v4.1 - Oct 2008).  On occassion, the code will raise an exception saying the source type cannot be found.  This error persists until the application pools recycle at night, at which point everything works again.  It tends to only affect one of the web front ends at a time (there are two). I tracked down where the exception was being raised, and this is the section of code:Type IValidationIntegrationProxy.ValidatedType { get { if (string.IsNullOrEmpty(this.sourceTypeName)) { throw new InvalidOperationException(Resources.ExceptionNullSourceTypeName); } Type validatedType = BuildManager.GetType(this.SourceTypeName, false, false); if (validatedType == null) { throw new InvalidOperationException( string.Format(CultureInfo.CurrentUICulture, Resources.ExceptionInvalidSourceTypeName, this.sourceTypeName)); } return validatedType; } } (As you can see, the value for this.SourceTypeName is shown in the exception and I've checked that it matches exactly.) We have never been able to reproduce this exception and at this point don't have any ideas left as far as causes.  For a while, my suspicion was that it was related to the Temporary ASP.NET Files folder.  The last

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?  

Enhance SSAS so that a calculation returns multiple cells at once (Excel fill not a single cell but

I wonder if somebody can help me with the following question. I would like to create an enhancement to SSAS in a way so that one can pass in multiple values, run a calculation and in return retrieves not one but multiple cell results at the same time e.g. retSet = functionABC(inSET) where inSet is somthing like 5 4 3 6 7 3 4 4 AND retSet is 4 6 7 8 9 3 4 4 All my calculated members in MDX return a single value BUT I need to have a calculation that if called returns multiple results (a set) at once and in a way so that Excel will properly pick up on it and consequently fills multiple cells in the Pivot table. Is that possible at all and if so how? I would not mind to write a little CLR assembly to enhance the SSAS but don't know how to pass the results back. Any ideas are highly appreciated. Dirk

SslStream.Read() - Returns invalid data

Hey,I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express.I have successfully made the client application establish a connection, and send data, which appears in plain, de-crypted text on the server - this works.However, I am 'polling' the socket to see if data is available to read.Here is some code which is appropriate:----        public void Process(int threadId)        {            int BytesRead = 0;            try            {                Master.Log("BEGIN READ");                sslStream.ReadTimeout = 5000;                BytesRead = sslStream.Read(bytes, 0, bytes.Length);                Master.Log("READ " + BytesRead + " bytes");                if ( BytesRead > 0 )                {                   // process                }             } catch (IOException e) {                Log("Caught IOException: " + e.Message);                if (e.InnerException != null)                    Log("=========> INNER IOException: " + e.InnerException.Message);         }---- Here is some console output when running the application:---------LOG: Authentication successfulLOG: BEGIN READLOG: READ 140 bytesLOG: [Thread 0] [Client 1] [Address] Client.ProcessDataReceived()Text received from client: Testing

Any way to execute a workflow when a caml query returns zero items?

Lets say I have a list with a status column and I want to execute a workflow when all items in the list have a status of complete. I basically want to execute a workflow when the caml query looking for non-complete statuses returns zero rows. Can I do this with SPD or are there any 3rd party tools for this? I'm thinking of writing one if there are not.

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

bug: subtract value from double returns invalid value!

Dim b as double  = 0.8 Dim a as double = 1 - b a contains the value 0.1999999996 in stead of 0.2 ???????????????????
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