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
T

tthellebuyck

@tthellebuyck
About
Posts
21
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sql cursor problem...
    T tthellebuyck

    Like I said I tried using a loop using a status field on the temp table: something like this while(select top 1 from _customerUpdate where [Status] ='INC') = 'INC' begin Begin Try perform customer update logic here... End try Begin Catch End Catch Update _CustomerUpdate set Status ='CMP' where CustomerUpdateID = @CustomerUpdateID. End Either way both of these ran incredibily slow...

    Database database sales help question announcement

  • Sql cursor problem...
    T tthellebuyck

    Every morning I have a temporary table that gets updated with Customer Sales data (year to date, month to day, last year to date, etc), from another database. One problem I have is that I get every single customer from that database, even if a customer's MTD, YTD,LYTD figures have no changed, resulting in getting 625,000 records. Another is that I need update Existing customer with the data in my temp table. I tried using a while loop and looping through my table to update records. I also tried select the records from the temp table and comparing the values to what is in the existing, the placing those records in a table variable and using a cursor on the temp table. Both of these take entirely too much time. Here is the T-sql for reference... Declare @ARbal money, @CustTreeNodeID uniqueidentifier, @CustomerNumber varchar(50), @CustomerUpdateID int, @LYSales money, @LYTDSales money, @YTDgm money, @YTDSales money, @MTDSales money, @LMTDSales money Declare @t table ( CustomerUpdateID int, CustomerNumber varchar(50), YTDSales money, LYSales money, ARBal money, LYTDSales money, MTDSales money, LMTDSales money ) insert into @t(CustomerUpdateID, CustomerNumber,YTDSales, LYSales,ARBal, LYTDsales,MTDSales,LMTDSales) select CustomerUpdateID, CustomerNumber, YTDSales, LYSales, ARBal, LYTDSales, MTDSales, LMTDSales from _CustomerUpdate u where exists (select 1 from CustTreeNode c join CustTreeNodeaccountAssoc ca on ca.CustTreeNodeID = c.CustTreeNodeID and (u.LYTDSales != ca.LYTD or u.YTDSales != ca.YTD or u.MTDSales!= ca.MTD or u.LMTDSales !=ca.LMTD )) declare mycursor cursor forward_only for select CustomerUpdateID from @t open mycursor while (1=1) begin fetch next from mycursor into @CustomerUpdateID if @@Fetch_status <>0 break; set @CustomerNumber = (Select CustomerNumber from _CustomerUpdate where CustomerUpdateID = @CustomerUpdateID) if isnull(@CustomerNumber,'')<>'' begin set @CustTreeNodeID =(select CustTreeNodeID from CustTreeNode where CustomerNumber = @CustomerNumber) end select top 1 @YTDSales = YTDSales, @LYSales = LYSales, @ARbal = ARbal, @LYTDSales = LYTDSAles, @MTDSales = MTDSales, @LMTDSales = LMTDSales from @t where CustomerUpdateID = @CustomerUpdateID update CustTreeNodeAccountAssoc set YTD = @YTDSales, LYTD= @LYTDSales,Balance = @ARbal where CustTreeNodeID = @CustTreeNodeID end close mycursor deallocate mycursor

    Database database sales help question announcement

  • Table Variable result set ???
    T tthellebuyck

    I have filled a table variable with some invoice data and it looks like this: Invoice# Batch# 733F7F75 946 733F7F75 924 733F7F75 929 733F7F75 940 733F7F75 948 733F7F75 939 733F7F75 947 733F7F75 923 733F7F75 938 733F7F75 922 733F7F75 927 733F7F75 944 733F7F75 945 I have a basic select query on that temp table, something like this: select InvoiceNumber, BatchNumber from @t order by InvoiceNumber what can I do to get the highest batchNumber (Underlined result up there ^) from my table variable?

    Database database question

  • Select Query problem...
    T tthellebuyck

    I need to run a standard select but I am not getting any results. The problem is, the user input goes something like '200' and the value in the field I am comparing to is '000200' (contains leading zeros, for some reason that is beyond me). Also, the data type for the column, in my table, is char and I also need to know if my parameter needs to be of the same type. Does anyone have any suggestions/ideas to best approach this situation? Thanks, T

    Database database help question

  • Selecting date range
    T tthellebuyck

    I need some help with a stored procedure, I have a table in my database that I am writing records to, specifically a BeginningDate field and EndingDate field. I want to be able to run a stored procedure that selects records based on a range of dates. This range of dates begins with monday and ends the following sunday, it covers an entire week. When I run the stored proc the where clause goes something like this: select UserID, BeginningDate, EndingDate, From tableName where UserID = @UserID and BeginningDate >= @BeginDate and EndingDate <= @EndDate I know that it will not return any records if there is a date that is less than the EndDate. My question is how can I adjust this so it selects the one record based on a BeginDate and EndDate parameters?

    Database question database css help

  • DateTimePicker
    T tthellebuyck

    That worked wonders, I can even use the same logic to grab the beginning of the week. Thanks

    C# question

  • DateTimePicker
    T tthellebuyck

    I have a dateTimePicker control on my form and I am working on a payroll entry form. I want the datetimepicker to default to the following sunday for the period ending date, if the user selects a day during the week. does anyone have any suggestions on how i could do this using the ValueChanged event? Thanks

    C# question

  • Regular Expressions
    T tthellebuyck

    Does any one have a decent regular expression for money. I am struggling to get one together, however I need one that matches for something like this: a dollar sign($) 1-4 digits 1-999 two decimal places 1.50 0 and will allow a blank textbox. If anyone has a regex for this or could point me to a utility that would do so, your help is greatly appreciated. thanks

    C# regex tools help

  • ColumnHeaderMouseDoubleClick event
    T tthellebuyck

    I have a DataGridView on a windows form. If a user clicks on a cell, a property gets the current row and then populates data in another form. When a cell is highlighted, if a user double clicks on the columnheaders the modal form loads with the data from the highlighted row. I want to stop users from being able to double click on the column headers. Does anyone have any suggestions on how I could do this? Thanks, Taylor

    Windows Forms question

  • DataGridView focus
    T tthellebuyck

    I have a datagridview that I can rows using the down error and enterkey. I have DataGridView.Focus() firing after my method to addrows. The focus is on the proper cell but the cell is not active to type in. Does any have any suggestions on how to make the cell active?

    C# help tutorial question

  • Stored Proc help
    T tthellebuyck

    I need some help writing a stored proc. First, I am inserting a range of ZipCodes into a db, ZipBegin and ZipEnd(12345-12346). Although that seems relatively simple, however, I need to check those ranges and make sure that there is no other over lapping range. for more clarity: range A 12345-12346 is in the db range B 12344-12347 is being inserted. as you can see these ranges overlap, if that occurs I need to use a raiserror and rollback the transaction. Does anyone have any suggestions on how I could do that?

    Database database help question

  • Zipcode stored proc.
    T tthellebuyck

    I need some help writing a stored proc. First, I am inserting a range of ZipCodes into a db, ZipBegin and ZipEnd(12345-12346). Although that seems relatively simple, however, I need to check those ranges and make sure that there is no other over lapping range. for more clarity: range A 12345-12346 is in the db range B 12344-12347 is being inserted. as you can see these ranges overlap, if that occurs I need to use a raiserror and rollback the transaction. Does anyone have any suggestions on how I could do that? Chance favors the prepared mind....

    Database database help question

  • Deleting rows from a dataset
    T tthellebuyck

    I have a DataGridView that contain information from a dataset. How could I go about deleting a row from my DataGridView and have the Dataset Reflect that change? I am using stored procs so SQLCommands will not be neccessary?

    C# question

  • bool values and radiobuttons
    T tthellebuyck

    Its both actually. I want to be able to select True or False two buttons, then pass that true or false value back to my datagrid. Do you have an example of how I can do that or does it all really depend on how data is passed back to the form?

    C# css question

  • bool values and radiobuttons
    T tthellebuyck

    I want to pass bool values(true/false) from a datagrid view to radio buttons to another form. Reason being, I am also passing other values from the grid to another form to edit the data. How could i go about passing a true or false value so when my edit form opens the radiobuttons are populated with either a true or false value, based on what value they hold in my datatable? Thanks

    C# css question

  • Populating data in a form
    T tthellebuyck

    Im am developing a windows app, and i have data populated into a gridview. Instead of allowing users to edit the data in the grid(which is probably the easiest way) I want to be able to select a row and have a modal form pop up with Textboxes and other controls to edit the data. How would i go about populating data in those controls from with the information of with the gridview?

    C# css question

  • Creating a new Gridview Record
    T tthellebuyck

    In my web app I have a gridview with some records that I can delete and update. The gridview is populated with individual user data. I want to have a single Add New button at the bottom of the Gridview that inserts new cells that I can add information. The app is written in C#.net using asp.net2.0. If any can help please let me know.

    C# csharp asp-net help announcement

  • Store Proc Problem
    T tthellebuyck

    Perhaps I should have mentioned I wrote this in C#.net. Thanks for the help though I can kindve determine how this is supposed to work.

    Database help debugging

  • Store Proc Problem
    T tthellebuyck

    I want to use a Gridview for a standard CRUD app. So far I have my delete event wired up but I have a problem with my stored proc. I receive this error everytime i run my debugger and click the delete event. I have a catch event to catch this error. The SqlParameterCollection only accepts non-null SqlParameter type objects, not Parameter objects. Here is the code for my deleterow event. Any help is appreciated. protected void DeleteRow(object sender, GridViewDeleteEventArgs e) { try { SqlConnection connection = new SqlConnection(); connection.ConnectionString = ConfigurationManager.ConnectionStrings["PokerTraxConnectionString"].ToString(); connection.Open(); SqlCommand delCommand = new SqlCommand(); delCommand.Connection = connection; delCommand.CommandText = "usp_Delete_Loan"; delCommand.CommandType = CommandType.StoredProcedure; delCommand.Parameters.Add(new Parameter("LoanId")); delCommand.ExecuteNonQuery(); SqlDataAdapter adapter = new SqlDataAdapter(delCommand); DataSet ds = new DataSet(); GridView1.DataSource = ds; adapter.Fill(ds); Cache["Loan"] = ds; BindPlayerNames(); connection.Close(); connection.Dispose(); delCommand.Dispose(); } catch (Exception ex) { errorMessage.Text = ex.Message; } }

    Database help debugging

  • dropdownlist in ASP.net page
    T tthellebuyck

    Alright I get that but say i wanted to populate one user's information from my table on to my web pageafter the selectedIndexChanged event, and I also want to be able to update, edit and delete that info, but I don't want to use a datagridview. How can I do this?

    ASP.NET csharp asp-net database 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