Jump to content
Xtreme .Net Talk

pcf108

Avatar/Signature
  • Posts

    30
  • Joined

  • Last visited

Everything posted by pcf108

  1. You might also want to try... System.Threading.Thread.Sleep()
  2. Well, I'm not sure if that would work in this scenario... After somethought, I came up with a pretty simple T-SQL solution using a temp table and updates. Putting the following in a stored procedure... SELECT *, AdjustWidth = Width - 1, AdjustThickness = Thickness + 4, TotalWidth = Width INTO #sizeResult FROM Orders UPDATE #sizeResult SET TotalWidth = 2*AdjustWidth + AdjustThickness SELECT * FROM #sizeResult I'm not sure that this method is efficient but it seemingly does the trick. The procedure could perform multiple selects into several temporary tables, but I'm guessing an UPDATE strategy would work better for more calculations. I didn't check performance. In addition, it might be possible to add columns to the temp table... From what I can tell CLR would work too (perhaps with better performance). Building a SqlMetaData result set and populating a DataSet, performing the calculations, and sending the MetaData through the SqlPipe. So, it looks like I have a few real-time options. Since I'm not working with 2005, I'll stick with T-SQL.
  3. That's what I was thinking, it's just that this result set would be used for reports, exporting, & ODBC connectivity to machinery. A SQL solution would likey fit the bill better... I keep thinking CLR in 2005 would do the trick, but i have zero experience, plus it kinda freaks me out, microsoft overload. I'll take a look at the expression columns though, sounds intruiging.
  4. I'm having a bit of design quandry... I need to return a result set of calculated values based upon multiple columns of data. Basically they are size calucations based on a table with Height, Width, and Thickness... In T-SQL... (simplified, AdjustWidth involves CASE and gets complex) SELECT [indent]Height, Width, Thickness, AdjustWidth = Width - 1, AdjustThickness = Thickness + 4, TotalWidth = 2*Width + Thickness + 2 TotalTimes8 = 16*Width + 8*Thicknes + 16[/indent] TotalWidth depends on "AdjustWidth" but it cannot be reffered to directly because is not a column. I'd like to be able to do something like this, with a local variable SELECT [indent]Height, Width, Thickness, @AdjustWidth = Width - 1, @AdjustThickness = Thickness + 4, @TotalWidth = 2*@AdjustWidth + @AdjustThickness TotalTimes8 = 8*TotalWidth[/indent] But this is not allowed in T-SQL. And I would need to return the variables in the result set. I could write the calculation all inline like the first example but it gets incredibly confusing and longer the deeper I get (mostly due to CASE statements). I could write the adjustments as functions but then calling the same functions over and over. I could build out a DataSet programmatically, but then I'd have some deployment issues. Any ideas on how to accomplish something like this on the back end? I'm thinking about attempting to do this with CLR in 2005... Thoughts?
  5. After some investigation, it seems that .NET does not have very good classes built for this yet. I'm switch to java and JAXB.
  6. I'm looking to create valid XML documents that match a specified DTD. I know that I can use XmlDocument DOM to create nodes one by one and output the document but this is tedious and I have several documents that I need to create that match supplied DTDs. It's also a problem because the DTDs change so frequently. I don't know if there's a way to do it in .NET with XSLT. If I could somehow translate the DTD into a typed DataSet and use that class to manipulate data and write the document out. Solving this would make me one happy programmer.
  7. i luv notepad Well, in case anyone is interested. I seemed to remember something about PDFs being readable in notepad. So I popped one open, and sure enough... Then downloaded the Adobe PDF reference manual. And found that there are textual tags such as "/Page " indicating a new page item and also tags for crop size and media size. So I'm parsing the pdfs for the heck of it... I think it'll work out but it seems so simple that i'm skeptical.
  8. Is there any way to retreive a PDF document's properties such as Page size, and page count? I have found several libraries that generate PDF documents, but I merely want to read some of the properties that are usually displayed in reader. The adobe PDFLib does not appear to have anyway of doing this. I am considering getting the adobe SDK (cost $200), but I'm not sure that it's not overkill or that it will work well with .NET Anyone have any advice/knowledge to share here?
  9. I am working on creating a script that spawns a thread and runs the Windows XP "lpr" command-line submitting a job to a poscript print server.... or something. It works fine, however... Unfortunately the windows LPR command does not have any method of supplying a copy count (that I know of). In unix/linux it's "-#<numberofcopies>". This basically negates the whole purpose of the script if I can't set the number of copies to print. Anyone know of a way i can send postscipt print jobs effectively from a windows workstation?? Is there any lpr command for windows that will do this?? Can I queue documents with raw data and the OpenPrinter and WritePrinter commands?? Some advice or a point in the right direction would be greatly appreciated.
  10. I'm guessing the problem is in your page handling the post. Are you using request.InputStream or request.Form("FName")?? Can you debug server side or perhaps run IIS locally and test to see if the request stream is coming as expected?
  11. I'll check out the ErrorProvider control... Thanks.
  12. I'm writing some code to better deliver error messages to users, I was wondering if anyone might have some source that they think might work well for delivering information from exceptions from try and catch. I've been using the console to catch the errors in development, but this isn't very useful to the user. If anyone could help it'd be cool. If not, I'll survive.
  13. That indeed does work. Thanks.
  14. Quick question, If I add two or more event handlers for the same event, is there any way of telling or changing the order in which they execute. Sample... Private Sub Click2(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click MsgBox("Event 1 Fired.") End Sub Private Sub Click2(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click MsgBox("Event 2 Fired.") End Sub
  15. Deeee... MouseUp event works for this if anyone is interested.
  16. I have a problem when I'm scrolling a datagrid and the cell moves out of the current view of the grid, the grid loses focus and the control with next tab index is focused. This then makes the grid no longer scrollable with the wheel because it is not focused any longer. Any suggestions on making the focus stay on the grid even when the current row/cell is not in view so it can be scrolled by it's entirety with the mouse wheel?
  17. Yes, I tried Click as well as the GotFocus event. I agree that traditionally this is not necessary, but it helps in some places.
  18. I'm trying to have a textbox select all the text whenever a textbox control gets focus. Code below works when the control gets focus via tab but when clicked it does not. When debugging, this event occurs but nothing happens, possibly because it occurs before the click is processed. Also does not work if I use TextBox1.Click event. Any suggestions?? Private Sub TextBoxEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles TextBox1.Enter DirectCast(sender, TextBox).SelectAll() End Sub
  19. I think this error comes from the data i try to insert into the table, not the inserting itself.
  20. Try using parameter field definitions since the parameters already exit in the report.. Also, I don't think you need the "@" symbol in front of the crystal reports parameters. try.. Dim crParameterFieldDefinitions As ParameterFieldDefinitions = ReportViewer.DataDefinition.ParameterFields Dim ParameterField As ParameterFieldDefinition = crParameterFieldDefinitions.Item("cnt_ID") Dim crParameterValues As ParameterValues = crParameterFieldDefinition.CurrentValues Dim spValue As New ParameterDiscreteValue() spValue.Value = intRowID crParameterValues.Add(spValue) ParameterField.ApplyCurrentValues(crParameterValues) for each parameter and see how that suits your fancy..
  21. Actually, what database are you using SQL Server 2000? Access?
  22. Are you sure you're comparing the right field? I see you're selecting Usernamn but comparing Username. Usernamn Like 'A%' ? Otherwise there is no reason why that shouldn't get both Upper and Lowercase names.
  23. You shouldn't compare the two as formatted strings, because that won't give a date comparison. "10" < "2" is true. Would... SELECTs ... WHERE Wiedervorlage <= #" + CDate(WVDate) + "#" Work for you??
  24. There's an article on using the AutoIncrement on microsoft.. http://support.microsoft.com/default.aspx?scid=kb;en-us;815629&Product=vbNET
  25. Unless I'm mistaken, The only provider that reads delimited data is the ODBC Text-File Driver... That however requires a file path instead of a stream, and to write every column to a file then re-read each one into a dataset would be ridiculous. I'd say your best bet is manual generation of a datatable, by creating a column for each field and parse the comma-delimited strings to populate the row.
×
×
  • Create New...