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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
C

cdietschrun

@cdietschrun
About
Posts
21
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Design auto-XLS editor?
    C cdietschrun

    At work a coworker has the need to automate some of his work. He has XLS files that have lots of blank columns and un-alphabetized entries in columns and he wants a version of that XLS that has been edited and adjusted and also has the ability to get appended to auotmatically later. What way could I go about thinking how to design something to do this? What language to start in? I know there are programs out there that do this, but all I found are ones that charge and also he wouldn't be able to get the company to pay for a program to do this for him. Any ideas/designs?

    Design and Architecture design tutorial question announcement

  • Invalid column name error?
    C cdietschrun

    set @sql=@sql+'update tbl_swbom_checklist_testers set '+@COLUMN+'='''+@VALUE+''' '
    set @sql=@sql+'where tester='''+convert(nvarchar(100),@tester)+''' and package='''+convert(nvarchar(255),@package)
    set @sql=@sql+''''

    Ended up looking like that, if anyone was curious.

    Database sharepoint database help question announcement

  • Invalid column name error?
    C cdietschrun

    I thought so, but that code is generated by the SP, and I am having trouble with the quotation/apostrophes that properly encase each one. Could you help me and show me how to edit the SP itself?

    Database sharepoint database help question announcement

  • Invalid column name error?
    C cdietschrun

    Error: saving tester - TST-000-341 - item :: System.Data.SqlClient.SqlException: Invalid column name 'TST'. update tbl_swbom_checklist_testers set passfail='No' where package=992-700-358 and tester=TST-000-341 That is part of the exception thrown by my web app. There is no column named TST, the column is named TESTER, which is why the SQL statement is 'where tester=TST-000-341'. The PACKAGE column is the same syntax and it has no complaints. What am I missing here? Here is my entire SP:

    CREATE PROCEDURE dbo.sp_UpdateTesterColumn
    (
    @PACKAGE nvarchar(255),
    @TESTER nvarchar(100),
    @COLUMN nvarchar(100),
    @VALUE nvarchar(100),
    @LASTCHANGEBY nvarchar(100)
    )
    AS

    declare @sql nvarchar(1024)
    set @sql=''

    set @sql=@sql+'update tbl_swbom_checklist_testers set '+@COLUMN+'='''+@VALUE+''' '
    set @sql=@sql+'where tester='+convert(nvarchar(100),@tester)+' and package='+convert(nvarchar(255),@package)

    print @sql

    exec sp_executesql @sql
    GO

    Obviously the print is when I uncomment the print statement. What am I missing here?

    Database sharepoint database help question announcement

  • SQL SP exception: "Incorrect syntax near '-'"
    C cdietschrun

    I am getting an exception thrown from my web app's call to a SQL SP. The expecption says "incorrect syntax near '-'". The dash I have narrowed down to an argument passed to the stored procedure contains dashes, such as 992-123-123. The SP works fine if the argument passed is 992123123. What is the best way of fixing this? In all likelyhood it is more important to keep the dashes in the entries in the columns. I think it is just my SP syntax, so here it is: @PACKAGE is the value that is giving issues, which is 999-999-999 style. CODE

    CREATE PROCEDURE dbo.sp_UpdateItemColumn
    (
    @PACKAGE nvarchar(255),
    @COLUMN nvarchar(30),
    @VALUE nvarchar(100),
    @LASTCHANGEBY nvarchar(100)
    )
    AS

    declare @sql nvarchar(1024)
    set @sql=''

    set @sql=@sql+'update tbl_swbom_checklist_items set '+@COLUMN+'='''+@VALUE+''' where package='''+@PACKAGE+''' '

    --print @sql

    exec sp_executesql @sql
    GO

    Database database question sharepoint announcement

  • Union HELP!!!!!
    C cdietschrun

    For Joe Smith, I have multiple rows that I want only the row that has both the name (WHERE TEMPLATEOWNER = 'Joe Smith') AND the row where the LASTCHANGE is the newest. So that first select should return the newest entry by Joe Smith. Then the second and third selects should find the one row that is the most recently updated by Jane and GI. The way it stands now, query analyzer shows three disjoint results. I need a joint record set. The removal of the order by in each select breaks the function.

    Database question help sharepoint

  • Union HELP!!!!!
    C cdietschrun

    The syntax works, but I have 3 disjoint selections as a result. I am looking to save one of the pieces of data in each row to a variable in VB.NET, if you can tell me how to do that without the union of the 3 results then that is fine. At the moment I don't know how

    Database question help sharepoint

  • Union HELP!!!!!
    C cdietschrun

    CREATE PROCEDURE dbo.sp_GetNewestTemplates

    AS

    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'Joe Smith'
    order by lastchange desc
    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'Jane Smith'
    order by lastchange desc
    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'GI Jane'
    order by lastchange desc

    GO

    WHY does that code give no errors but this does:

    CREATE PROCEDURE dbo.sp_GetNewestTemplates

    AS

    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'Joe Smith'
    order by lastchange desc
    union
    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'Jane Smith'
    order by lastchange desc
    union
    SELECT TOP 1 *
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    WHERE TEMPLATEOWNER = 'GI Jane'
    order by lastchange desc

    GO

    I need this to work! What am I missing, and how can I get around this ridiculously annoying error? All it says is "Error 156: Syntax error near union."

    Database question help sharepoint

  • SQL Stored Procedure push in the right direction :)
    C cdietschrun

    So I am working on this SP for my DB at work:

    CREATE PROCEDURE dbo.sp_CreateChecklistForPackage
    (
    @PACKAGE varchar(255)
    )
    AS

    INSERT INTO TBL_SWBOM_CHECKLISTS
    (
    PACKAGE,
    TEMPLATEOWNER,
    STEPNUMBER,
    STEPNAME,
    DESCRIPTION,
    LASTCHANGE,
    LASTCHANGEBY
    )
    select
    @PACKAGE,
    TEMPLATEOWNER,
    STEPNUMBER,
    STEPNAME,
    DESCRIPTION,
    LASTCHANGE,
    LASTCHANGEBY
    FROM TBL_SWBOM_CHECKLIST_TEMPLATES
    GO

    What I need it to do is find the newest entry for each of the three users (specific names that I can test against, like "TEMPLATEOWNER='Joe Smith') and put only that template into the SWBOM_CHECKLISTS table only. So the TBL_SWBOM_CHECKLISTS table should have one entry per package made up of three. So basically I need it to find the newest entry from each of the three user's separate entries and then put that into the other table. I think it's fairly simple and doable, just not 100% sure.

    Database database sharepoint

  • SQL Stored procedure help
    C cdietschrun

    Actually, nevermind, I figured it out. Thanks!

    Database database sharepoint json help question

  • SQL Stored procedure help
    C cdietschrun

    With that one, I get an error I had before in my ASP page from calling this procedure: "Conversion from string "" to type 'Double' is not valid." Does that mean some of the types of the columns in the databases don't match? Also confusing to me is that none of the columns are of type string or double. (I'm fairly new to SQL) Thanks kindly for your help.

    Database database sharepoint json help question

  • SQL Stored procedure help
    C cdietschrun

    Can someone tell me what's wrong with this code? Basically the sp takes in one parameter and is creating a new record in tbl_swbom_checklist the values, with the package variable being set by the parameter, the rest being set by tbl_swbom_checklist_template entries.

    CREATE PROCEDURE dbo.sp_CreateChecklistForPackage
    (
    @PACKAGE varchar(255)
    )
    AS

    INSERT INTO TBL_SWBOM_CHECKLIST
    (
    PACKAGE,
    TEMPLATEOWNER,
    STEPNUMBER,
    STEPNAME,
    DESCRIPTION,
    LASTCHANGE,
    LASTCHANGEBY
    )
    values
    (
    @PACKAGE,
    SELECT
    TEMPLATEOWNER,
    STEPNUMBER,
    STEPNAME,
    DESCRIPTION,
    LASTCHANGE,
    LASTCHANGEBY
    FROM SWManagement.dbo.TBL_SWBOM_CHECKLIST_TEMPLATES
    )
    GO

    Database database sharepoint json help question

  • Site loads slowly in IE6 only, how to fix?
    C cdietschrun

    This may be the fix, I've only had a few minutes to check, but it might be. I'm curious, why would this be?

    Web Development javascript html database help tutorial

  • Site loads slowly in IE6 only, how to fix?
    C cdietschrun

    All computers across our company recently updated by IT.

    Web Development javascript html database help tutorial

  • Site loads slowly in IE6 only, how to fix?
    C cdietschrun

    I know JavaScript, I've made other websites with it, my question is why would something load slower in IE6 than in IE8 or Firefox? Where do I look to optimize?

    Web Development javascript html database help tutorial

  • Site loads slowly in IE6 only, how to fix?
    C cdietschrun

    My new project at work is to see why an internal website we have loads very slowly on IE6 (the standard browser we use, I can't change that) and fine in any other browser. Basically it is just an index.html but then loads a JavaScript (?) menu bar that displays things when hovering over and different links and what not. I have the .js but I don't really understand it all and don't know what I'm looking for. My boss says he thinks the best thing to do is ". Not sure what to do there except create a new menu (similar in look and function) in javascript to make things faster and look better. There are apparently a few .js files associated with the menu. I think you can streamline the menu and use a class to make it faster." I see it is made in JavaScript and also it is a menu "class" and I don't see where to begin for me to clean it up. Any advice?

    Web Development javascript html database help tutorial

  • Out of range exception when using spaces to SQL? [modified]
    C cdietschrun

    I'm new to SQL and am getting an exception on my webpage when I have an argument to my SQL DB that has spaces in it. Basically, the page is being passed a name like "Name with spaces", which is being sent as templatename: (in VB)

    ra = New SqlDataAdapter("exec sp_GetTemplateByName '" & templatename & "'", TestStatConn)
    ra.Fill(dt)

    The exception gets thrown at this line only for names that have spaces, not if a templatename is passed like "name_without_spaces". The exception is System.IndexOutOfRangeException: There is no row at position 0.

    ret &= "<td><span style=""color:#a9a9a9"">" & CheckForNullVal(dt.Rows(0).Item("lastchange")) & "</span></td>"

    The sp_GetTemplateByName:

    Select
    ..stuff..
    from tbl_checklist_templates
    where templatename=@TEMPLATENAME
    order by stepnumber

    Can anyone shed some light on what's going on here? Edit: If I remove the single quotes from this line

    "exec sp_GetTemplateByName '" & templatename & "'"

    and make it

    "exec sp_GetTemplateByName " & templatename & ""

    everything acts the same, except when I click on a template name with spaces, I get this exception: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '%'. From line 55:

    ra = New SqlDataAdapter("exec sp_GetTemplateByName " & templatename & "", TestStatConn)
    (THIS is lne 55) ra.Fill(dt)

    modified on Friday, June 26, 2009 10:43 AM

    Database database sharepoint question

  • Drop down list value reeturned on submit button being clicked?
    C cdietschrun

    Sort of. Remember that the first button is not an input type, it's just an href to a javascript because it HAS to have 2 parameters passed to it. That javascript needs to get this third value from the drop down in order to send all 3 parameters to a PageMethod. Here it looks like You made a "Click Me" that pops open the div, I assume waits for the selection, then closes it?

    Web Development javascript tools help question

  • Drop down list value reeturned on submit button being clicked?
    C cdietschrun

    I have a drop down selection box with items in it. I need to be able to pass the selected item through using an onclick event for the "Submit" button. Is this possible? I have a JavaScript that is calling a div to popup. This div is the drop down selector. I want the user to click a button to make the drop down appear, then they must select an item in the list and then hit submit. The submit button being clicked I need to bring in the selected value from the drop down and use it in the script that originally told the div to pop up (this is the first button that the user clicks, it actually runs the script which passes 2 variables, and is basically waiting on the drop down selection to save into a 3rd variable, which will then call a PageMethod). I have

    function AddTemplateToUUT(uutnumber,testerid){

    var templatename=SelectTemplateToAssign();
    PageMethods.AddTemplateToUUT(testerid,uutnumber,templatename,CallbackDiv,CallbackErrorAlert,'divchecklistarea');
    

    // ShowSelection('divtemplateblock','hide');
    }

    function SelectTemplateToAssign(){

    ShowSelection('divtemplateblock','show');
    var tname=document.getElementById('drptemplateselect').value;
    alert(tname);
    ShowSelection('divtemplateblock','hide');
    return (tname);
    //PageMethods.AddTemplateToUUT(uutnumber,testerid
    

    }

    Anyone please help?

    Web Development javascript tools help question

  • JavaScript function not defined problem [modified]
    C cdietschrun

    I have a .aspx page that has 2 javascript calls on it. They worked previously and now are broken. Through Firefox's web development addon, I am getting errors like:

    ToggleDetail is not defined
    TesterDetail.aspx?name=xxx

    I have checked everything I can think of 100 times over: 1) My .aspx page has a ScriptManager with

    path="testerdetail.js"

    in it. 2)My testerdetail has the correct spellings of the functions being called. 3)The number of parameters in the call and declaration match What am I missing, why is this happening? Here is one of the functions with issues in JavaScript:

    //opens new or existing checklist template form page
    function OpenChecklistForm(id,uut){
    window.open('ChecklistForm.aspx?UUT='+uut',&tid='+id'_blank''scrollbars=yes,resizable=yes');
    }

    With an error from Firefox web dev kit saying "Missing ) after argument list", but points to the single quote after uut in the window.open call.

    modified on Tuesday, June 23, 2009 4:14 PM

    Web Development javascript help regex question
  • Login

  • Don't have an account? Register

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