Jump to content
Xtreme .Net Talk

quwiltw

Leaders
  • Posts

    493
  • Joined

  • Last visited

Everything posted by quwiltw

  1. I'm running XP professional. The problem is that I've got all my command buttons set to Flatstyle=System and they look xp-style in the designer, but when I run the application the buttons look like old regular buttons. What's wrong?
  2. Geez.. I'm starting to have a codebase of workarounds:( This time I've found that the System.Web.HTTPUtility has an HTMLDecode method that does the trick. The dataset must automatically encode all of the content so that XML serialization doesn't break. This works, but seems kinda weird to reference System.Web.anything in a WinForms app.
  3. I'm getting an xml representation of a dataset to transform against a stylesheet -- it works fine. I want to let people include URLs 'a hrefs' right in the text though. Somewhere in the process, it htmlencodes (or the equivelent) the 'a' tag stuff making it appear as regular text. Anyone know of a way around this?
  4. Not that I've done this before, but just picking up on that thought, if the audit data doesn't need to be immediately accessible, you could probably just log bulk dataadapter update operations but stuffing the entire "before" block of a DiffGram in an audit table. It wouldn't be "easy" to peice things back together but doable.
  5. Just out of curiousity, why are you using ADO stuff and not ADO.NET? Can you cut and paste the query into QueryAnalyzer and see if it'll run? That's always the first thing I try just isolate the problem.
  6. Methinks in any case the tables will grow very fast, one of the unavoidable side effects of auditing. I must say I don't like the idea of keeping the audit records and the "current" records in the same table though. I think I'd be inclined to create a mirror of each audited table and put the audit records there. (of course, I'm no dba, I just pretend sometimes on our smaller projects).
  7. Not sure how hard it is to define new code tags, but it'd be nice to have an 'sql' code tag. It's obviously not that important but just another little thing to enhance the forum. I could provide the list of keywords, if needed. Of course if it already exists and I've just missed it, let me know.
  8. This one assumes all columns are defined as NOT NULL and I think looks much cleaner. SELECT * FROM tblAddresses WHERE Address1 LIKE COALESCE(@Address1,Address1) AND Address2 LIKE COALESCE(@Address2,Address2) City LIKE COALESCE(@City,City) AND PostalCode LIKE COALESCE(@PostalCode, PostalCode) I guess I should note that these queries are *really* costly with so many LIKE's, if you don't need the LIKE , then you should definitely replace them with an =.
  9. Here's a trimmed down version of what I use. It's for SQL Server, so it'd change depending on your datasource (not sure if Access accepts optional parameters or not?). Here you can pass in any or all of the four columns and it'll search against whatever you pass. If all of the columns are NOT NULL, then there's a much more elegant solution using SQL Server's COALESCE function (if this is your situation let me know and I'll post it). CREATE PROCEDURE dbo.spAddressSelectFilter ( @Address1 varchar(255) = NULL, @Address2 varchar(255) = NULL, @City varchar(255) = NULL, @PostalCode varchar(255) = NULL, @SessionToken uniqueidentifier = NULL ) AS SELECT * FROM tblAddress WHERE (( Address1 LIKE @Address1) OR (@Address1 IS NULL))AND ((Address2 LIKE @Address2)OR (@Address2 IS NULL)) ((City LIKE @City) OR (@City IS NULL))AND ((PostalCode LIKE @PostalCode) OR (@PostalCode IS NULL))
  10. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassitemtopic4.asp Specifically, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassitemtopic4.asp MyDataSet.MyDataTable.Rows(n) returns reference to datarow.
  11. Does it have to be a listview? or will a datagrid do? The reason I ask is that it'd be trivial to do using an expression column on a datatable behind a datagrid, but I think you're going to have to do it manually with listview, who knows though, I'm not very good at GUI stuff maybe someone else will have an idea. This should give an idea of what I'm talking about... Public Sub Init() Me.DataSet1.Tables.Add("mytable") Me.DataSet1.Tables("mytable").Columns.Add(New DataColumn("Initial_Val", GetType(Integer))) Me.DataSet1.Tables("mytable").Columns.Add("Factor", GetType(Integer), "Initial_Val * 5") Dim r As DataRow r = Me.DataSet1.Tables("mytable").NewRow() r("Initial_Val") = 5 Me.DataSet1.Tables("mytable").Rows.Add(r) Me.DataGrid1.DataSource = Me.DataSet1 Me.DataGrid1.DataMember = "mytable" End Sub
  12. Not sure if there is an easier way (don't think you can directly include another language in your project), but you could create a C# project that holds this file, add this project to your solution. Then reference this project in your existing project. Once you've got the reference you can call it the same as you would any other class.
  13. I think this should have been posted to Random Thoughts.:p
  14. can you post the entire Button2_Click Sub? (in code blocks) btw just noticed I didn't actually create the dataadapter. need to add the following line to your code too. adp = New OleDbDataadapter()
  15. I use the dataadapter, something like this... Dim con1 As OleDbConnection Dim cmd1 As OleDbCommand 'added Dim adp As OleDbDataadapter Dim ds1 As New DataSet() Dim str1 As String str1 = "Provider=SQLOLEDB;Data Source=WIN2000\SQLANA;Initial Catalog=pubs;Integrated Security=SSIP" con1 = New OleDbConnection(str1) cmd1 = New OleDbCommand("Proc2", con1) cmd1.CommandType = CommandType.StoredProcedure 'added adp.SelectCommand = cmd1 con1.Open() 'added adp.Fill(ds1) 'added con1.Close()
  16. You can't. You didn't say C# was the language of choice. Optional is a VB.NET keyword so as I said above it works in VB.NET.
  17. You need to do that in client-side script, like javascript which has alert("hello") and confirm("sure?") functions.
  18. It works in VB.NET, being a .NET related forum, I generally try to provide answers that work in .NET. Ummm... NO. Method overloading is probably a better approach to getting the functionality you require, but the Optional keyword is there just as I said above -- it is exactly what you asked for btw.
  19. myClass.myMethod(Optional someParam As String = "")
  20. My opinion is that auditing outside of the database is not worth much. To do it I suppose you'd have to use the versioning of the dataset and manually iterate over the rows of the datatable doing two inserts for all added rows, an insert and an update for modified rows, and an insert and delete for deleted rows. I think the Item of a datarow lets you get at the different versions (Original/Current).
  21. Have you set up the update/insert/delete commands? either manually or with commandbuilder? This link might help. http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/UpdateDataFromDB.aspx
  22. Are you using the Update method on the dataadapter?
  23. Have you taken a look at the Data Access Application Block from MS? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/daab-rm.asp
  24. Bucky I'm curious, the DOM is obviously a pig because it's entirely in memory. On the other hand, you suggest xml serialization which uses mad reflection (yet another incredibly costly operation). I guess I question whether you're really gaining anything using xml serialization over the DOM giving the overhead of reflection to and fro involved in serialization. Are you aware of any metrics or is this just so obvious I'm a moron for questioning it?
  25. I thought I read somewhere that one couldn't depend on the currentrow index of the datagrid to be the same as the underlying datatable, but it works and I can't find that now. Thanks,
×
×
  • Create New...