1. Strange bug (x-posted to aspdotnet, sqlserver)

    Date: 01/13/05     Keywords: sql

    I'm getting some weird behavior in a function I wrote.

    Private Function GetServerStatus() As Integer
    Dim strDataSource As String
    Dim myConnection As SqlConnection
    Dim myCommand As SqlCommand
    Dim intStatus As Integer
    strDataSource = ConfigurationSettings.AppSettings("DSN")
    myConnection = New SqlConnection(strDataSource)
    myCommand = New SqlCommand("GetSystemStatus", myConnection)
    myCommand.CommandType = CommandType.StoredProcedure
    myConnection.Open()
    intStatus = myCommand.ExecuteNonQuery()
    myConnection.Close()
    Return intStatus
    End Function

    It uses the stored procedure "GetSystemStatus":
    CREATE PROCEDURE dbo.GetSystemStatus
    AS
    DECLARE @SystemStatus int
    SELECT @SystemStatus=MAX(systemstatus)
    FROM Config
    RETURN @SystemStatus
    GO

    The weird behavior is that GetServerStatus() returns -1, but when I run GetSystemStatus in Query Analyzer, it returns 0 (or whatever the value is).

    Source: http://www.livejournal.com/community/aspdotnet/23458.html

  2. databinding issues... Take two

    Date: 01/06/05     Keywords: asp

    Hello hello,

    Ok so here's (another) ASP.Net 2.0 question...

    I've got a GridView that's bound to a table that has several lookups:

    Field A, B and C are foreign keys. B & C's values depend on A so if A changes, so must the possible values for B & C.

    I store A's value in a Session variable. This works out nicely 'cause in ASP.net 2.0, you can set Select Parameters to values of Session variables. However -- when I change the value of the Session variable, the following error occurs:

    Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

    I'm guessing that it's due to the following problem: the dropdowns I use for looking up the values of B & C are not happy about re-binding while the row is being edited, either because of the SelectedValue binding or simply because it will not re-bind to the datasource I use for the lookup.

    Any idears?

    tia

    Source: http://www.livejournal.com/community/aspdotnet/23258.html

  3. Curious bug, or problem with code?

    Date: 01/03/05     Keywords: asp, web, microsoft

    I've got a curious error with ASP.NET 2.0 but before I go reporting it to Microsoft, I thought I'd toss it around here:

    I've been playing around with the new GridView control and so far it's been quite nice with the new gimmicks -- cuts about 90% of my code straight out. However... Inserting isn't implemented yet. It is, however, implemented in the DetailsView control.

    So I decided to tackle the problem this way:

    MyForm
    |
    -------> MyMultiView
    |
    -------------> View1 => MyGridView, MyInsertButton
    |
    -------------> View2 => MyDetailsView

    I have a form with a multiview. The multiview has two views, one with a Gridview and a button entitled 'Insert', the other with a DetailsView. For viewing/editing/deleting, I use the GridView. For insertion, I switch views to the DetailsView and change mode to insert. So far so good.

    Next, when the DetailsView changes modes (back to readonly), I have it switch back to the original view. Here's where the error occurs: any other action throws the following exception...

    Description:
    An unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the error and
    where it originated in the code.

    Exception Details:
    System.Web.HttpException: Failed to load viewstate. The control tree into
    which viewstate is being loaded must match the control tree that was used to
    save viewstate during the previous request. For example, when adding controls
    dynamically, the controls added during a post-back must match the type and
    position of the controls added during the initial request.

    Source
    Error:



    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.


    Stack Trace:


    [HttpException (0x80004005): Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.]
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +589
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +404
       System.Web.UI.Page.LoadAllState() +608
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1826
    



    So -- where is the problem coming from? Am I getting the events screwed up? Is there something I'm forgetting? Or is there really something amiss..?

    Just in case, here's the code:

    Sub AddActivity_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    AdminMultiView.ActiveViewIndex = 4
    DetailsView1.ChangeMode(DetailsViewMode.Insert)
    End Sub

    Sub DetailsView1_ModeChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    If Not DetailsView1.CurrentMode = DetailsViewMode.Insert Then
    AdminMultiView.ActiveViewIndex = 0
    End If
    End Sub

    Source: http://www.livejournal.com/community/aspdotnet/22855.html

  4. question

    Date: 01/01/05     Keywords: no keywords

    so whose using .NET 2.0 already for development?

    Source: http://www.livejournal.com/community/aspdotnet/22616.html

  5. Can anyone help?

    Date: 12/17/04     Keywords: programming, html, asp

    I posted this to Experts Exchange first and have yet to get anything back so I'm hoping some fellow LJers can help me out. Instead of typing everything again please visit the following link to see if you have any suggestions for what I am trying to do:

    http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21245567.html

    Source: http://www.livejournal.com/community/aspdotnet/22030.html

  6. VisualStudio.net and CVS

    Date: 12/17/04     Keywords: no keywords

    Anyone have any experience integrating VisualStudio.Net with CVS source control?

    Source: http://www.livejournal.com/community/aspdotnet/21788.html

Previous page  ||  


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home