Jump to content
Xtreme .Net Talk

pelikan

Avatar/Signature
  • Posts

    90
  • Joined

  • Last visited

Everything posted by pelikan

  1. I may be wrong, but why use strings? SELECT * FROM ScheduleView WHERE DateDiff( day, StartDate, schStartTime ) > 0 AND DateDiff( day, schStartTime, EndDate ) > 0 ORDER BY hID, schStartTime
  2. Master - Detail very simple to set up. //Set up the master detail relation //create the relation linking the tables DataRelation myRel = new DataRelation("MasterDetail", myDS.Tables["Master"].Columns["m_ID"], myDS.Tables["Details"].Columns["m_ID"]); //add the relation to your DataSets Relations collection myDS.Relations.Add( myRel ); //bind the Master table to whatever (grid, combobox, listbox, textbox) //if a grid GridMaster.SetDataBindings( myDS, "Master" ); //bind the child table to your grid - note the qualified name used for //the data member "TableName.RelationName" GridDetails.SetDataBindings( myDS, "Master.MasterDetail" ); Thats all you have to do. Navigation is automatic - moving to a different row in the Master table resets the Details grid.
  3. Your db model looks a little funky guy. suggestion: for the link table service_id customer_id exp_date the PK is just (service_id, customer_id) you need to create the foreign key constaints also. Now when you need to update the sevice for a customer just add the length of the period to exp_date. if you want to automatically do something (like email a customer when their service expires) - create a 'job' that runs at regular intervals. The job could email the customer and delete the record from the link table if exp_date < NOW() or some such.
  4. msxml is a COM object - you cant run it from the command line. You may script the object using JScript or VB - but why bother ! the NET framework already has all the classes you need to use XSLT.
  5. Sounds like you need to implement custom paging. Check out the DataGrid.AllowCustomPaging property in the SDK Documentation to see how to do this. Quite some time ago I had to solve the same problem with the ListView windows control (by writing a superclassed COM Component using ADO). You hook into appropriate events - say [Page Up] [Page Down] etc. and fill the control manually based on you're calculated page index.In ADO .NET you'd fetch a new page into your dataset or datareader and manually fill the ListView. A complicated but doable operation.
  6. what you're trying doesn't sound plausible - the compiler creates either a windows executable, or a console app - you can't have it both ways - try factoring out the common code into classes and create two executables.
  7. you could use the Lines property and check the length of the array - or - assuming you don't need an array of lines: rtb.GetLineFromChar( rtb.TextLength ) + 1 // number of lines
  8. you need to intercept one of the WM_NC.. windows messages sent to the form window. eg. WM_NCLBUTTONDOWN the 'hit-test' code for the message is HTCAPTION to get the values for these constants (API-Viewer? windows.h? if you ever had VS 6) I'm new to C# so not sure how to hook the WindowProc of the form - maybe use the NativeWindow class. :cool:
  9. often a SQL script used to create a database is saved. You just rerun the script to recreate the database.
  10. MSDE2000 is SQL Server 2000 with limited concurrency and no interface. It has the full power of T-SQL.
  11. ADO .NET uses a disconnected dataset model - you should load both your tables into one dataset using one connection - the connection is then released - now use your tables.
  12. depending on your 'condition' for deleting rows, there might be a still simpler solution. Use SQL. DELETE FROM table-name WHERE condition make sure your where clause is correct first or you'll end up deleting rows you want to keep. This would be the text of the OleDbCommand which is the DeleteCommand of the OleDbDataAdapter. You can set up parameters on the command to control what gets deleted dynamically. eg. "DELETE FROM Authors WHERE (firstname = ?)
  13. Net 2.0 and SQL Server Yukon will both support XQuery.
  14. It's not clear what you are trying to accomplish. Do you wish to persist the rows in the copy, do you wish to delete the rows from the original database?? or do you only want to keep track of the users selections??
  15. you might find this article informative: http://www.codeproject.com/cs/database/csharpaccessdb.asp tons of info on this site as well as msdn and framework sdk help
×
×
  • Create New...