
Denaes
Avatar/Signature-
Posts
975 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Denaes
-
You need a few things. 1. You need to have the identity (Table1ID) for Table1 set to increment. This means each new row will have a new number. 2. You need to make sure there is a relationship between both tables and the changes are set to cascade. This means you have to insert/update table1 prior to table2 and delete in the opposite order. You need the relationship there because if the database is assigning an identity itself, it's not going to be whatever your dataset or you come up with. So when you insert the Table1 Rows, you'll get a new identity when the data refreshes (which should be on an insert really, but depends on the SQL) and when that new identity comes in, it'll cascade to the Table2 foreign keys. Also watch out when you're creating new datatables and copying results and possibly merging things. Huge headache. Even though it's a new object, it still keeps references and causes problems if you don't copy/merge properly. It's all rather counter intuitive as are a few things in a dataset.
-
Same here. In fact when I first saw this thread my first thought was a recursive function. Still I often have to do things with the files (open them, count the size, lines, move/copy, etc) so I can't just trash my Recursive Files in Directory Snippit
-
IO.Directory.GetFiles("C:\\New Folder", "*.BMP", IO.SearchOption.AllDirectories).Length IO.Directory.GetFiles("C:\\New Folder", "*", IO.SearchOption.AllDirectories).Length The top Line returned the number of bitmaps I had in sub directories of New Folder and the second line returned all the files, so this format seems to work. Though I did try with only a few hundred, not tens of thousands, there might be a problem with such large amounts of files.
-
I hope with the VS2005 SP, they make it so that VB's Edit & Continue actually works. On all the machines we have running VS 2005 Pro (5 of them) at a point in our project we were getting 100's of errors a day. Something would happen and throw like 40 errors, then require everyone else to exit Visual Studio while a utility was run on VSS. This would happen on each machine about once every 2 hours. We found some online documentation linking it to a glitch in Edit & Continue. Disabled and went from VS crashing 2-8 times a day to maybe once every 2-4 weeks. It would be nice if they fixed the way VS checks out files. MS admits there is a bug when VSS checks out files for you that you don't need to edit, but they say it's not that big of a bug and most likely won't be fixed in this version. But it's good to hear that a SP will be out a year after release rather than 4 years after release.
-
If you're using 2005, and the Load Event is the problem, the code might be better off in the Shown event which runs every time the form is shown.
-
huh, I wonder what version of 2005 you're using. On mine (VS 2005 Professional using VB.net) I have those options on the Standard Toolbar and I can Customize them off/on. Solution Configurations is the name of the dropdown to choose how to build and Solution Platform is the machine to target. Well if you can get what you need done, then thats good. I just find it odd that you guys are missing these features.
-
On VS2005 Professional's default tab strip (with the open, save, cut, etc), there is a green arrow for run and a dropdown next to it where I set Debug/Release and another dropdown next to it which is where I define the CPU for the build. Right clicking on the solution name in the Solution Explorer and choosing properties brings up a dialog called "Solution <solution name> Property Pages". I click on Configuration Properties and I get a list of every project in my Solution and I can select where each builds to Debug or Release. If I right click on a Project Name in the Solution Explorer and choose Properties and select compile, I can set up various options for each of the compile modes. I hope this helps you guys out
-
Language preferences on all posts? (Cagsy's blog)
Denaes replied to Cags's topic in Suggestions, Bugs, and Comments
Wow, thats an odd translation. I think it depends on each site (there are others) if they're translating the C# code directly or if they're translating the IL Code. The IL code seems like it would be trickier. That statement was pretty straight forward that it's a "for i = x to y" so it's pretty interesting that you got a Threading.Interlocked.Increment(i)... maybe thats the code that's behind a "+=" -
The way you're describing it, there are three steps: 1. Scan the body to copy all the information. 2. Kill the body via disentigration. 3. Create a clone based on information. If 1 & 2 happen without 3 occuring, does that mean that the person had died? If you consider this death, but not death if #3 takes place, then death has to be redefined that a body can shut down or be destroyed, but life continues if a copy is created. If just 1 & 3 happened, are they both the same person since you can't tell them apart? You have two people who are identical, one was born and the other was cloned. At what point do they become different people? When they eat different food and you can tell them apart biologically? If #3 happens on day 1, day 2, day 3 & day 4, each of the 4 persons are exact copies of the person as of when they were scanned as they are constructed. Is the newest one constantly the "real one" because he's identical to the base self? Or are they all the real living one even though they're no longer identical? What makes a person the real copy? Just the first one? The additional ones are just clones that aren't the person? What if a person is recreated, then killed and another copy is recreated? Is that person also "real" because he's identical to the data copied from the origional? Or is the "real" person dead because the first copy was killed? If you go by "identical = actual person" then this is a recipe for immortality. But by our current definition of death (ceasation of bodily functions) and how this "teleportation" concept was presented, the origional is dead. The new one is an identical clone. If this becomes possible, someone is going to have to redefine what death is. I admit, without Copy&Paste/Cloning records, if you're identical to your base self, there isn't any real way to proove that someone has died. But not being able to proove something doesn't mean that it didn't happen.
-
Language preferences on all posts? (Cagsy's blog)
Denaes replied to Cags's topic in Suggestions, Bugs, and Comments
I linked the most useful conversion tools I've used on your thread :) -
A few tools I've used in the past to become more proficient in learning or translating something from C# I did't really understand or converting something in VB to C# to see how something was done: VB.Net to C# Web Translation C# to VB.Net Web Translation Reflector shows you code for all procedures in an assembly in both C# & VB.Net SharpStudio has it built into it's IDE. There were also some actual windows apps to download that did the same thing, but I've been using the web apps if needed. I know Reflector is 2.0 compatable/compliant, but I'm not sure about the others.
-
Language preferences on all posts? (Cagsy's blog)
Denaes replied to Cags's topic in Suggestions, Bugs, and Comments
If you don't know both languages, just use the tool that converts C# to VB.Net and visa versa. Thats how I learned most of the C# I know. I would write it in VB.Net and hit convert and see what changed. There really aren't that many differences and once you get a basic gist of C# you can at least vaguely figure out what someone is getting at. -
I don't think it's dead, but it's definatly less popular. Schools out for summer, so thats part of it. There are maybe 5-10 full timers here and maybe twice as many part timers (like me) that are here and then gone for a bit. I think the ExtremeVB Forums took up a lot of the people.
-
IMO, the easiest way to do this is going to be to create a View or a Stored Procedure on the Database that merges these 5 tables into one super table. Or create a procedure in your dataset that creates a DataTable with all the info you need. But I haven't used Crystal Reports yet, so maybe 5 related tables are just as easy to use. How we're going to do it on the project I'm working on, we're going to use databases Stored Procedures to send the database values (maybe "all" or maybe an employees name/number for example) and have the relevant table for the report created and returned. But this is our plans. We're still a month or two away from really getting into the reporting.
-
I'm doing my validation on rowchanged events in the dataset, but sometimes the database passes back an exception. When the database passes back an exception, it sets a Row Error. The only way I can see to clear the Row Error is to run RowWithErrors.ClearErrors(), but this also clears out all other validation errors on the Columns. The only workaround I can see is to go through the columns and copy their errors, run RowWithErrors.ClearErrors(), then run through the columns again and reassign their errors, which seems a little akward. I'm sure I could come up with a procedure that handles this generically, but is there something I'm missing that's a little more straight forward?
-
Have you added the reference for System.Management in your project references?
-
Well what is the solution?
-
Marble_Eater suggested using the AppDomain as well in another thread. But... there is always a but. I'm doing this at design time, not runtime. An Assembly can only be loaded into one AppDomain at a time and because the Assembly I'm loading is loaded into the projects (or solutions, I'm not sure) AppDomain, I can't load it into a new AppDomain.
-
error MSB3021: Unable to copy file "obj\Debug\Common.DataAccess.dll" to "bin\Debug\Common.DataAccess.dll". The process cannot access the file 'bin\Debug\Common.DataAccess.dll' because it is being used by another process. Done building project "Common.DataAccess.vbproj" -- FAILED. I call a Macro that loads the "bin\Debug\Common.DataAccess.dll" file into an Assembly instance, then I use getTypes() to run through all the types and I copy some names off into a collection for use in the Macro. At this point, I set the assembly instance = to nothing. There isn't any Dispose or ReleaseAssembly. But when I attempt to rebuild the "Common.DataAccess.dll", I get the error that it's in use. Looking at various pages, MS's example doesn't even set the assembly to nothing and most of the examples only set the instance to nothing. None of it's methods/properties seem like they would help. So how can I force this to release it's hold on the file? Here is the code I'm roughly using: Dim assData As Reflection.Assembly assData = Assembly.LoadFrom(Path) For Each typeData As Type In assData.GetTypes If typeData.FullName Like "TableAdapter" Then ' Code to copy text from the type End If Next assData = Nothing I load it, I get it's types and then set it to nothing.
-
Well as to what I was doing: Creating a macro that could be called from within any dataset class and have a template created based on the tables the dataset has. What I did: 1. I used DTE.ActiveDocument to get at the file I was calling the Macro from and DTE.ActiveDocument.ProjectItem.ContainingProject. This got me the full filename I was running the Macro from and the name of the project. Since I follow the convention of keeping the classname the same as the filename, that works out well. 2. Using the complete filename, I dynamically knew where the assembly was. I created an instance of the Assembly using the path from the file, adding in "bin\debug\" and the project name ".dll" which got me the assembly. Yeah, so this means the project has to be built after adding a class & prior to using the macro. 3. A loop for each Type in Assembly.GetTypes and checked that the type contained the ClassName & "TableAdapters." Oh, and Marble... yesh that did make my head spin. But thank you. I really need to learn more about the tricks of reflection, especially for these Macros that this project will need. You're right that I don't actually need an instance of the class, so much as I need access to find out the names of the tables the dataset has. So I might be revising how I did things once I understand some of these reflection methods better, but it's workable now.
-
Actually that code above did return only the table adapters that were part of that dataset. I created a TableInfo class & TableCollection, and for each TableAdapter I created a new TableInfo which had properties for getting the TableName, TA Name, TA Namespace and a few other choice methods that made things easier. With collection in hand, I wrote the class and cycled through the collection at key locations. Macro done, should be working but I need to test it with multiple and single tables.
-
Getting to the basics, a function takes in a string (the name of the class). For example "CustomerDataset". Given this string, I want to find all the tables in the Class. something like: Dim DS as Class = Reflection.ConvertStringToClass("CustomerDataset") or Dim DS as getType("CustomerDataset") I'm not picky about how I'm doing this, just so long as I end up with access to the tables collection of the dataset, being given a name. It might help to say I'm using this in a Macro, so I'm not sure if DTS will help at all with this. Thanks if you have any info
-
I've found the easiest way for me (I get confused sometimes with having handlers floating all around) is to take to the code from Reset and put it in a function. Call the function from btnWissen_Click & txtReset_Click.... and it looks like txtReset_Click is calling another event (the form load event?). So, in my simple eyes, that code that you want to call from three different events should just be a function called directly. In C# I would definately do it this way. In VB.Net I might just as well play with the handlers because I'm more comfortable with vb.net... but I still don't like the idea of multiple procedures handling the same event. Just confuses me on the bookkeeping end.
-
I found something here: http://www.15seconds.com/issue/051123.htm Under Using Macros to Generate Data Access Code it goes onto do nearly what I'm talking about. Almost. It looks like this code here: For Each typ As Type In targetAssembly.GetTypes() If typ.FullName Like "*" & ItemName & "TableAdapters." & _ "*TableAdapter" Then TableName = typ.Name.Substring(0, _ typ.Name.LastIndexOf("TableAdapter")) line = "Dim ta" & TableName & " As " & ItemName & _ "TableAdapters." & typ.Name DTE.ActiveDocument.Selection.NewLine() DTE.ActiveDocument.Selection.Text = line taList &= "ta" & TableName & "," UpdateType = typ.GetMethod("Delete") If UpdateType IsNot Nothing Then UpdateList &= "ta" & TableName & "," End If Next would be nearly what I'm looking for. Though without a chance to test it yet, it looks like it's grabbing all of the TableAdapters in the whole assembly, not in a particular dataset. Which is fine if you want to generate the code for every table adapter all at once. Since I'm looking for all the adapters in a particular class, I would use the DTE.ActiveDocument to parse out the name of the class and use reflection to find all the tables in the class (which IMO would be easier than trying to find the TableAdapters with a partial namespace match of the classname) I'll post more here as I get it, that way if anyone does a search it'll be here :D
-
I'm looking to write a macro that I can fully customize with knowledge of a class. For example, I'll be using a typed dataset Person which has say 3 tables on it. I want to be able to run the macro in the Person Partial Class and have it create an instance of a table adapter, my custom Fill, Refresh & Persist methods as well as transaction logic if there are 2+ tables. So basically I could work everything out given that I know how many tables there are and what their names are. An advanced version might take the relationships into account. This is the best article I've found for macros: http://msdn.microsoft.com/msdnmag/issues/05/07/XMLComments/ so far. It helps with the code writing, but not how to access or pass a class into macro. There isn't a whole lot out there and a lot of it is rather specific, so any articles that access a class would be great.