
quwiltw
Leaders
-
Posts
493 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by quwiltw
-
you'll need to check syntax but it should go something like this.. Dim strProp as String strProp = ctlDataBindings.Item(0).PropertyName.ToString() Dim typ as Type = GetType(ctl) Dim propInfo as PropertyInfo = typ.GetProperty(strProp) If Not propInfo Is Nothing Then Dim objVal as Object objVal = propInfo.GetValue(Nothing, Nothing) End If
-
ashrobo, if that's all you're doing with the data is looping through to count it you'd likely do well by taking wyrd's recommendation and letting the db do the count for you.
-
Answer: props = typ.GetProperty("Text", BindingFlags.Public Or BindingFlags.Instance Or BindingFlags.DeclaredOnly) In my opinion, this ain't exactly straightforward, oh well.
-
Anyone know a combination to find only overridden properties using GetProperty() of a Type? I keep getting ambiguousmatchexception because it finds both the base class' property and my overridden one. Here's a mock-up of what I'm trying to do. My class: Public Class NewTextBox Inherits System.Windows.Forms.TextBox Private m_strText As String = "" Public Overrides Property Text() As String Get Return m_strText End Get Set(ByVal Value As String) m_strText = Value End Set End Property End Class GetProperty attempt: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim typ As Type typ = Me.NewTextBox1.GetType() Dim prop As PropertyInfo prop = typ.GetProperty("Text") If Not prop Is Nothing Then prop.SetValue(Me.NewTextBox1, "My New Value", Nothing) Else MessageBox.Show("Not found.") End If End Sub This returns ambigous match and I've tried several BindingFlag parameters to the GetProperty() method to no avail. Seems like it should be fairly easy.
-
To those who take programming classes in college (or have)
quwiltw
replied to wyrd's topic in Water Cooler
Nope. Then it would be called "Training" instead of an "Education". Hopefully, you're gaining an understanding of concepts and problem solving techniques that transcend any current day programming skills, techniques, or languages. -
How to get Position of a Row ....
quwiltw
replied to Mischamel's topic in Database / XML / Reporting
Select will do the trick but just use: Dataset.Table.select("id=4") or you could use the Find method of the DataView. For some reason I usually find myself using that instead. -
I think no one is disputing the Clear() method call. It's the call to Update immediately afterwards that seems pointless because you just cleared all the data that you are requesting the update for. If you feel you need this line because it has some strange side effect on your select command, I'd still suggest you comment it out and dig deeper to find the root of the problem. As for the "code works as is on five other forms"... I can't count the number of times I've said "... but it's the exact same code" only to remember that little difference hours of debugging later. If it's truly the same code perhaps you should consider inheriting from a base form that can do this work for you?
-
I don't *think* you can with the microsoft grid. You'll probably have to go to a third-party grid control for that. I'm using Infragistics UltraWinGrid which supports it.
-
Yeah, if I do that it works and if I set the Datasource directly to the DataTable it respects it, but I have to only set datasource to the dataset because I need the different bands based on the relations to show up too. I finally took the incident hit and called Infragistics, they've taken it on as a bug. We've found a few others and they usually have them fixed in the next hotfix, so hopefully it's the same with this. For now, I'm using the filtering model of the UltraWinGrid.
-
Binding to the views directly works fine in Form view but (much like Access) I have to flip into Datasheet view (using UltraGrid). To do this properly I think I need to set the datasource of the grid to the dataset so that it'll recognize the DataRelations properly. The problem comes in when I want to apply a filter to the DefaultView of one of the datatables, the grid doesn't respect it. That make any sense? I guess I would just expect that if a filter is applied to the DefaultView of a DataTable, then *all* subsequent access to that DataTable should respect the DefaultView? That wrong to expect? Any other ideas on how to solve this?
-
I'm binding to a dataset with the datamember being the tablename. The problem is that it doesn't seem to respect the DefaultView of the datatable. I need the datasource to be at the dataset level so I can't directly set it to the view. I've ensured that I'm consistently referencing the DataSource/DataMembers properly. The problem is that it doesn't recognize when I apply a filter to the default view of one of the tables. Anyone have any clue why?
-
Take a look at the Data Access Block for .NET. It'll help out with some of this. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/daab-rm.asp
-
emulate recordset.find method for dataset.
quwiltw
replied to hemenkap's topic in Database / XML / Reporting
Did you try Find off of the DefaultView? [msdn]System.Data.DataView[/msdn].Find -
Actually, I tried it all. System.Diagnostics.Process doesn't work either even without the method on there.
-
***drifting back on topic.... I couldn't get it to work with System.Diagnostics.Process, I edited out the Process class and it works. Maybe a bug? http://www.xtremedotnettalk.com/showthread.php?s=&postid=363411#post363411
-
Look into... [msdn]System.Diagnostics.Process[/msdn].Start()
-
I've only created some samples so far just playing around with it so can't provide much input. But, the project I'm on right now has some pretty complex reporting requirements and CR is the package we're using. So sometime this summer, I should be more useful to those people asking CR-related questions:)
-
Depending on what exactly you need there are examples on this page of how to use regular expressions to pull out links. See if it gets you started. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconregularexpressionexamples.asp
-
Create an new dataset and add the table to it would be the easiest way then serialize this new dataset. You could either inherit the DataTable and add this to it or create a helper class so that this "wrapping" is transparent and it looks like you're really writing out just the datatable. Ahhh... Heiko beat me to it:)
-
I think you should be using TimeSpan since DataDiff is in the Microsoft.VisualBasic namespace. But that's probably little more than a personal preference to try and avoid that namespace as much as possible.
-
That will work in SQL Server. Not sure abou the others. It wouldn't hurt anything to try it. You'd get the answer a *lot* quicker too.
-
Apparently all you have to do is group them using parenthesis, then pull out the matches using the Groups collection of the match. The Groups collection appears to go like this: 0 - Returns the Whole expression 1 - Returns the first sub-expression 2 - Returns the second sub-expression and so on... This does what you want. Dim source As String = "(<{2})([0-9]+)(>{2})" Dim s As String = "Hello world <<898989>> hello world " Dim reg As New Regex(source) Dim r As String r = reg.Match(s, source).Groups(2).Value
-
That actually still works for this. If there are other numbers in the string that don't have the "<< >>" then that could present some issues. If that's the case, "<+[0-9]+>+" this will find the entire string like this "<<898989>>" and then maybe a subsequent "[0-9]+" on that would get the number in the middle. Someone that's good at regex's could probably craft a way to get just the number in one step -- obviously, that someone isn't me:) I think regex's are probably your best bet. Small improvement = "<{2}[0-9]+>{2}"
-
I'm kinda rusty at regular expressions, but something like this should match it. "[0-9]+" It may need to get more complex depending on how the string is.