Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 4501940

@Member 4501940
About
Posts
22
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error when loading ASP.NET page
    M Member 4501940

    You should be using WebForms not WinForms for an asp.net web app. didn't mean to post twice - connection error on my end

    ASP.NET csharp help asp-net winforms sysadmin

  • Error when loading ASP.NET page
    M Member 4501940

    WinCrs wrote:

    'Microsoft.ReportViewer.WinForms'

    is for windows applications. For web apps: 'Microsoft.ReportViewer.WebForms'

    ASP.NET csharp help asp-net winforms sysadmin

  • performance issue
    M Member 4501940

    Agree with digital man. First thing to look at is SQL. Also, does the site have images for the products? Are these optimized? How are they handled? Are you storing in db? Need to see some code to help more...

    ASP.NET performance architecture help question

  • user should not login again if he is loggedin once during same browser [modified]
    M Member 4501940

    Gmail - Your assumptions are not accurate. If you do not 'sign out' of gmail in mozilla, it will open the inbox page. Same with IE. IE and mozilla operate completely independant of each other. This behavior is usually acceptable. Assuming you are using the aspnet membership provider, you can test 'signout' functionality using FormsAuthentication.SignOut();. Anytime the signout is used, I also kill the session using Session.Abandon();. The membership provider behaves similar to gmail if that is the desired result.

    ASP.NET help com sales

  • user should not login again if he is loggedin once during same browser [modified]
    M Member 4501940

    Session variables are not shared from window to window like that. If using forms authentication, this is what you are looking for.

        if (this.User.Identity.Name == "Admin")
        {
          Response.Redirect("Admin/AdminHome.aspx", false);
        }
    

    Normally you would do this the other way around. If the user tried to access AdminHome without being logged in, send them to the login and bounce them back from there if successful login.

    ASP.NET help com sales

  • Passing value to confirmation box
    M Member 4501940

    Yes, you are so right. I am 'old-school' and use mostly server-side confirmations.

    ASP.NET question database

  • Passing value to confirmation box
    M Member 4501940

    In order of preference: 1 - Include that column as a DataKey in the DataKeyNames property of the GridView. 2 - Use the column as a CommandArgument property of the Button. 3 - Use a HiddenField.

    ASP.NET question database

  • Insert record in Identity field of table using CommandBuilder
    M Member 4501940

    An identity field can not be set using insert. It will be auto-incremented by sql. If you want to intially set the values because you need to seed the table with pre-existing values, remove identity, insert values, then turn back on. On an on-going basis, if you want to control the values in the identity column, you will not want to have the field as an identity column at all. sqlbulkcopy does have an keepidentity option. http://msdn.microsoft.com/en-us/library/tchktcdk(VS.80).aspx[^] For performance reasons, I would handle the identity outside of the sqlbulkcopy process as well as other contraints and indexes. Depends on what, how often, how much...

    modified on Thursday, March 25, 2010 9:27 AM

    ASP.NET database question announcement

  • How to open PDF from server?
    M Member 4501940

    The files do not have to be in 'my project' but they do have to be in an internet share that have the proper permsissions set. IIS and aspnet do not have full run of the OS and can not directly access server paths as you mentioned without punching some big holes in security. So. Create a share, set permissions and you are good to go.

    ASP.NET sysadmin tutorial question

  • Rowspan in html table according to the record from DB....
    M Member 4501940

    Yes, that whole logic thing will get you everytime.

    Dim connection As New SqlConnection("server=MyServer;Trusted_Connection=true;database=MyDatabase")
    connection.Open()
    Dim command As New SqlCommand("select MyKey,MyField1,MyField2 from MyTable order by MyKey;", connection)
    Dim reader As SqlDataReader = command.ExecuteReader()

    Response.Write("<table border='1'>")
    'Read the first record
    reader.Read()
    'Set the control break
    Dim ControlBreak As Integer = CInt(reader(0))
    'Write all cells
    Response.Write("<tr><td>" & reader(0) & "</td><td>" & reader(1) & "</td><td>" & reader(2) & "</td></tr>")

    While reader.Read()
    If reader(0).Equals(ControlBreak) Then
    'Write some cells
    Response.Write("<tr><td colspan='2'> </td><td>" & reader(2) & "</td></tr>")
    Else
    'Reset the control break
    ControlBreak = CInt(reader(0))
    'Write all cells
    Response.Write("<tr><td>" & reader(0) & "</td><td>" & reader(1) & "</td><td>" & reader(2) & "</td></tr>")
    End If
    End While
    Response.Write("</table>")
    reader.Close()
    connection.Close()

    ASP.NET database javascript html tools help

  • Rowspan in html table according to the record from DB....
    M Member 4501940

    Sure. http://www.cerritos.edu/dmellas/cis103/chap07-mod.pdf[^]

    ASP.NET database javascript html tools help

  • Rowspan in html table according to the record from DB....
    M Member 4501940

    The requirement is simply using 'control break logic'. Search for it. Note that the sort order of the recordset is important. Read the first record. Save the 'control break' (userid?, can be more than 1 value). Write_All_Cells. For every record after that... Read. If value same as saved 'control break' then Write_Some_Cells (one td has a column span = n) else replace control break value Write_All_Cells

    ASP.NET database javascript html tools help

  • Best Practices Q
    M Member 4501940

    "When inserting or updating via proc that it is a good practice to return the new or updated rec using output parameters." Opinions - one way or the other - appreciated. Thanks

    Database discussion

  • Help me understand this unusual query... [modified]
    M Member 4501940

    Something is wrong...in ansi sql databases: The rows returned in the first query will be equal to or greater than the second. All of the rows in the second will be included in the first. The rows returned in the third query will never be in the first or second. Need to figure this out before thinking about indexes and wildcards. I would change the second qry as such: WHERE tblField1 = char(32) just to be sure because-

    select ascii(' ') --this equals 9
    select ascii(' ') --this equals 32

    Create and put data in your Table1 and test if you are not convinced.

    Database database help tools question

  • transaction error
    M Member 4501940

    You have a begin tran on the outside of a while loop and have a rollback on the inside with an unconditional commit on the outside. If a rollback occurs, the loop continues transaction-less and the commit will execute anyway = your error 3902. I would not wrap a transaction around a while loop if there was another way (there is!). Never issue a commit or rollback without checking to see if there is actually a tran.

    if @@trancount > 0
    	rollback transaction
    

    I would use a try-catch, without a doubt. Heres generally how a transaction could be handled:

    begin try
    begin transaction

    --dml statement here

    if @@trancount > 0
    commit transaction
    end try

    begin catch
    if @@trancount > 0
    rollback transaction
    print error_message() --(execute my error handler)
    end catch

    Some of the other wierd messages you are getting is because the proc failed to issue a commit or rollback at all leaving 'things' in an un-committed state. Until you have verified that the proc you are developing will always close the trans - issue either a commit or rollback after each 'test'.

    Database sharepoint database xml help

  • Table rows vs. comma separated
    M Member 4501940

    Yes, lots of experience. Just finished a db optimization contract(job). The client was adding a million records every couple of days. Have been doing the same for 20+ years. The Receive Table may have a lot of records in it but only 2 columns and those columns will make up the primary key. To query for a given record, you will use the pk. Clustered, indexed, primary key 2 columns only - should be able to get any given record in about 3 milliseconds or less with 10 million records in it. Subtract a ms or 2 if your id values are numeric. This type of table will not take up much space. This will be thousands of times faster than searching for a partial string value in text where you will won't be able to find the user by using an index - at all. (not easily anyway) Searching for a string in a text type field is a VERY time consuming operation for a db to do - not a good idea. I would create test scripts and data to validate if you're not convinced. Let me know if you need help. What db are you using?

    Database question database sql-server visual-studio help

  • How to identify the ID of row which has been modified?
    M Member 4501940

    I concur. This is NOT the place for a trigger. I only use triggers to store 1)disposable, 2)derived and 3)complex data used for reporting or searching. Must meet all 3 criteria. But to answer the question-

    UPDATE Demo
    Set BeModified = 1 WHERE ID IN (SELECT ID FROM inserted)

    OR

    UPDATE Demo
    Set BeModified = 1
    FROM Demo
    INNER JOIN inserted
    ON Demo.ID = inserted.ID

    This is assuming sql server. The "inserted" table is a virtual table which contains all of the fields and values from the insert, update or delete that fired the trigger. You might think that only a record at a time is updated but in fact since it is possible to update multiple records at the same time, this may NOT be what you want. But thats what you get with triggers. If you ever have to update all of the records in that table, BeModified will be set to 1 for all. Be warned.

    Database database help tutorial question announcement

  • Table rows vs. comma separated
    M Member 4501940

    assuming that the recipient list are also users User Table Columns UserID+User Message Table Columns MessageID+Message Sent Table Columns UserID+MessageID (using the senders user id) Receive Table Columns UserID+MessageID (using the recipients user ids) use csv if recipients are not users or you don't need to track don't use csv if you intend to parse later - not effective

    Database question database sql-server visual-studio help

  • need query to calculate amount
    M Member 4501940

    Either of these will work if using sql server

    with temp (ReceiptNo, CustomerID, Amount)
    as
    (
    SELECT ReceiptNo, CustomerID, Amount
    FROM customer
    group by ReceiptNo, CustomerID, Amount
    )
    select CustomerID, sum(Amount) from temp group by CustomerID
    GO

    /*** or this one ***/

    SELECT ReceiptNo, CustomerID, Amount
    INTO [#temp]
    FROM customer
    GROUP BY ReceiptNo, CustomerID, Amount
    select CustomerID, sum(Amount) from #temp group by CustomerID
    GO

    drop table #temp
    GO

    C# database sales

  • "Top Rated Video" Sorting algorithm
    M Member 4501940

    To be honest, you have to lie! You could assume that every video has the same number of votes. The votes that are not 'real' would be neutral or average. If your scale is 1-5 and every video has the same number of votes then the video with the one vote at 5 also has 199 at 2.5. ((199*2.5)+(1*5))/200 video 2 needs 176 votes at 5 to equal video 2's rating better still assume all videos have 1000 votes (or whatever) - still works out the same video 1 with 200 votes at 4.7 (200*4.7+800*2.5)/1000=2.94 video 2 with 1 vote at 5 (1*5+999*2.5)/1000=2.503 video 2 with 176 votes at 5 (176*5+(1000-176)*2.5)/1000=2.94

    Web Development algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups