Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
I voted for more cowbell in the last election so don't blame me. Diesel does what Diesel does best - we don't want him wasting his time as an Admin as it would take away from his posts.
-
The first rule of admins is... you do not talk about admins.
-
If you only need 1 license, I'd suggest the source control system by Perforce. It's usually quite pricey but, from what I hear, quite good. It's free for up to two people - you can download it directly from them. I've used VSS for years without any troubles at all. It's not the best, I hope, but I've certainly not encountered the troubles that others have talked about. I've used it because it came free with MSDN Universal (not sure what it's called now - universal is the older name I believe). I've heard good things about subversion as well though I can't say anything - no personal experience with that. -ner
-
We're looking into the email option - it's currently disabled for this site so it's not just you. For now, if you want to receive messages I'd recommend turn PM back on. -ner
-
Thanks PD. I was getting that impression from all my googling. No one seems to have registered this as a complaint. I'm surprised, since many example do have DataSets living in the App_Code folder but they don't mention a problem with not having access to the namespace or the designer class. Thanks! -ner
-
You're not going to show us what code you've got so far? Are you trying to build one monster big string of all inserts? Why not go for simplicity, if this is a one time conversion where performance won't matter? In that case, have some loops that do the work: for each table in MySql Create Table in Access for each row in MySql insert row in Access You may want/need to add foreign keys, primary keys, etc. as well. That all depends on your requirements of how close the Access database must match the MySql database. -ner
-
[SQL][SQlite] Pattern matching with subquery
Nerseus replied to Varghjärta's topic in Database / XML / Reporting
I'm going to look at this one blurb that you provided: ## items #id(int) | path(string) | tags(string) 0|"item1"|"o,2," 1|"item2"|"1,2," ## tags #id(int) | name(string) 0|tag1 1|tag2 2|AnotherTag Is your question about filtering appropriately or on how to SELECT the tags associated to your items? In either case, you seem to want a relationship between items and tags - I think you want something like 1 item associated to 0 or more tags? If so, you really need to store the tags in another table for a relational database to work. It will definitely be a bit more work, but then the queries will actually work. Trying to define relationship values inside of a string field may be more compact, but just won't work. You'll need another table, something like this: Table: items Columns: id (int) path (string) Table: ItemTags Columns: itemID (int) tag (int) Table: tags Columns: id (int) name (string) The data would then have two rows in item and 4 rows in ItemTags, two tags associated each of the two items. If that's what you want, let us know - we can then help with your queries. -ner -
In ASP.NET 2.0 I can add a DataSet to my project (in App_Code for example), but I can't see the Designer.cs file. The application is building me a typed dataset because I can "see" it from another class (one that instantiates the dataset). This works fine in a Console or Winforms application. My guess is that I can't see the designer (or the real "properties" for the dataset, such as the one that says "MSDataSetGenerator") because there is no project file in ASP.NET 2.0. Similarly, how do you set the namespace for the dataset? Regardless of where I put the DataSet file, the namespace is always just the class name. For example, if the structure of files is this: /App_Code/Test/Test2/DataSet1.xsd I end up with a class DataSet1 with no namespace. I've tried setting various properties about the dataset, such as Prefix and Namespace, but these our XML properties and not really the code-generation namespaces as I think of them. Using the WAP (web project file, the new add-on thing from Scott Guthrie) is not an option at this point. Anyone else run across this? -nerseus
-
You'll have to add a blank value to your dropdownlist. This is typically the first entry, but doesn't have to be - you can set the SelectedValue or SelectedIndex to match the blank. If you're using ASP.NET 2.0 and binding your dropdown then you can take advantage of the new AppendDataBoundItems property. In the page you can specify one blank entry with: <asp:ListItem Value="" Text=""/> Then on the dropdownlist itself, set AppendDataBoundItems to true. When you add the code to bind the dropdownlist, the new items will be appended after the blank value. If you're using ASP.NET 1.x, I've traditionally added the blank to my datasource when doing binding. If you're not binding, then just add the blank :) -ner
-
I'm actually running the full SQL Server 2005 developer edition. I had to use "attach database" to attach the files, but it was still painless. Check out the readme on SQL Express, but I'd guess that it would run side by side with SQL 2000. You might also check and see if it would work with SQL 2000. I didn't look at the code long enough to notice if it's using any new features... I'm going to start using ProntoWiki more next week and let some other devs that work for me use it as well. Nothing like being the boss to push a new technology on lab rats... I mean junior devs :) -ner
-
Thanks for the links! I really like the ProntoWiki - ASP.NET 2.0, SQL Express backend and more! I got it up and running without issue and has all the basics, including a bit more (such as attachments). Thanks for all the help. -ner
-
I'm a casual Wiki user - I use wikipedia.org for all sorts of things, but I'm no wiki master. I'm proposing the idea of a wiki for my company, to hold a repository of developer related docs at first with the potential to grow if the idea catches on. We currently use Sharpoint for our document repository but it has a LOT to be desired. Has anyone had any experience with installing and using a .net based wiki? Ideally .Net 2.0 but even a 1.1 solution would be nice. I'm looking to use this as a document repository, where our team can add pages of tech specs and various diagrams (JPGs, unless something better is supported). We have a license for SQL Server for various inhouse applications so I don't mind if it requires that (it would be ideal, actually). I did a bit of googling on wikis, to find a solution that I could implement. Twiki sounded ideal in terms of what it offered but the solution is not .net and not meant to run under windows and IIS. I found OpenWiki, written in plain vanilla asp and it seemed Ok out of the box, but a bit old fashioned. Thanks in advance for any advice! -ner
-
If this is meant to offload, you may be able to push for a 24-hour stale version of the data. Meaning, you'd build some kind of nightly batch job that calculated all your summary columns and put the results in a new table. Special reports (or data file extracts) would use this table to get the results. Clients would just have to agree that 24-hour stale data is Ok since you'd only want to take this hit once a day. I've implemented that kind of solution in the past. If your organization (or the client who's paying for the solution) can afford a stand alone reporting server that may even be better. That opens up a lot of possibilities, but comes at the cost of more hardware and possibly the complexity of a replication scheme. Just a few other ideas if you need a more data-centric approach where you won't be able to pull back data to some kind of C#/VB code for processing. -ner
-
I've often put calculations in my SQL, if they're simple or straightforward. If there's lots of CASE logic, it's a toss-up - I may still keep it in SQL if it makes the most sense. Two other options come to mind. First, expression columns in the dataset. Second, wrapping calls to your proc in a common C#/VB function that adds the columns programatically. I might consider the expression columns first, because they're a bit easier to setup. But expression columns do have issues - the biggest being I don't believe you can do any "if" logic in them, at least not in .NET 1.x - I haven't looked into .NET 2.0. The programatic solution seems the best in your case. What you describe is the need to get some base data out of the table, and from that base data get some new results, mostly calculated. That sounds like domain/business logic that's best put in the code that's easiest to understand and maintain. -ner
-
Converting string to double problem... (so simple)+
Nerseus replied to EFileTahi-A's topic in General
If that's really what's happening, it sounds like the CultureInfo somewhere is defining the "." period as a thousands separator instead of the decimal point. So maybe it thinks "7.5" looks like "7,5" which to me is still stupid, but maybe what you're seeing? -ner -
passing null value as an argument to a function
Nerseus replied to a1jit's topic in Database / XML / Reporting
Since you mentioned database, I assume you want to check for an actual NULL in the database - different from a null/Nothing in C#/VB.NET. Use System.DBNull.Value for your SQL parameter. If you're using a DataSet, make sure the value in the appropriate column is DBNull.Value. If you're building a dynamic string to send to SQL you'll have to put in the string null without quotes, same as you would in a Query window. For example, if you had a Table1 with 4 columns and the int3 column needed a null value: INSERT INTO Table1 (int1, string2, int3, date4) VALUES (1, 'hello', NULL, '1/31/1999') -ner -
Changes to App.Config file are not reflected?
Nerseus replied to kaisersoze's topic in Windows Forms
The App.Config file is a "helper" by Visual Studio - I don't know the real name, but that's what I call it. Behind the scenes, when you build your project it copies the current app.config from the "root" folder of your project to the \bin\Debug folder (or whatever release/folder you use). It also renames it to the proper name - the name matches the assembly plus a config extension. So for an EXE project named "Test.exe" you'll have "Test.exe.config". If you want to make changes while the app is running, you'll have to modify this file - open it manually in notepad (or even Visual Studio). Every time you rebuild the file will be replaced by Visual Studio with the values in the app.config file so don't forget to put your changes back in the app.config file. -ner -
I would do a forum search as this has come up before - simply look for "barcode". First, you'll need a barcode scanner (a hardware device). Most come with software that make them act like a keyboard. The user presses a button to read a barcode and the text is spit out to the computer as if the keyboard typed it. There isn't any special software, usually, beyond that basic functionality - at least not in my experience. -ner
-
I don't know much about loading a DLL into a different domain, but doing a Google on AppDomain Load FileNotFoundException produced a couple of articles that sound to me like you're not supposed to be trying what you're trying? For example, from one article by Brad Adams, a Program Manager at MS: Sorry I'm not more help... -nerseus
-
Normally you would use a DataAdapter and a DataSet, but there are many methods. Here's a code snippet to get the schema for a table named Customer: // Assumes a using statement at the top: // using System.Data.SqlClient; SqlDataAdapter adapter = new SqlDataAdapter("SELECT TOP 1 * FROM Customer", "<connection string here>"); DataSet ds = new DataSet(); adapter.FillSchema(ds, SchemaType.Source, "Cust"); Note that the string "Cust" used in the FillSchema method will be the name of the table in the DataSet. The schema is based 100% on the SelectCommand. I've seen some people use "... WHERE 1 = 0" in place of the "TOP 1" to prevent any rows from being returned. You can use whatever you like. If you need to actually get the data AND the schema, then use the DataAdapter's Fill method. I've read articles that mention getting the schema through FillSchema is somewhat slow and shouldn't be used in production. I guess it depends on what you want the schema for... -nerseus
-
Whenever you have tables or columns named with reserved words or invalid characters, you need to wrap the names in brackets. In your case, the column State/County will need to be [state/County]. It won't hurt to wrap them all, though you may just want to wrap those that are necessary. -ner
-
I think he's asking to interface directly into Notepad? If so, that's a bigger topic... -ner
-
There's already Windows Script Host (wsh), which can be like batch files but use a higher level language - albeit closer to VB6 and not made for .NET. I haven't heard if there are any plans on adding .NET support to something like WSH - maybe some else has? I like WSH for when I need it. Luckily, I don't need it very often. Less often, but still used, is the old BAT file. I can muck around with what I need which, thankfully, isn't very much. :) It might be fun to make a language of your own though - who knows? -ner
-
Assuming this is for Windows (not web), you can call the PerformClick() method on the button (Button1.PerformClick()). Normally that would be considered bad practice unless you're writing some kind of automated test software that has to record button clicks and simulate them. Most would prefer that the Click event call a method. Then where you want to call PerformClick you'd just call that function. For example: public class Class1 { protected void btnSave_Click(...) { Save(); } private void OtherFunction() { // Some other code ... // Code where you want to call the Click event: Save(); } private void Save() { // Do something } } -ner
-
You're asking some important questions - not always easy to answer. First, I'd suggest getting a good OOP book, not just an article. A book can go into more depth on things like interfaces, abstract classes, etc. These are common things to use, but knowing when to use which takes a bit of practice to learn. Here are my versions of answers to your questions. 1. Why use operator overloading? In some cases, it makes the code more readable. You could have Int32.ParseFromString, Int32.ParseFromStringWithFormatProvider, Int32.ParseFromStringWithFormatProviderAndNumberStyles, etc., but that would be tedious. More often than not, overloads are used when some parameters aren't strictly necessary and there's a common default or when you need multiple versions of a method that each take a specific type and you don't want to use "object" and do type checking. 2. Interfaces are a big subject. An interface tells you what behavior your class must have, but not how to do it. Also, you can implement many interfaces, but you can only inherit from one class (regular or abstract). 3. An abstract class is useful when you have core stuff you want to expose to multiple subclasses, but don't want anyone to create that base class. The common example is a Shape class, with methods to Draw(). You don't want anyone to create a Shape() class, but you want to use that for a Rectangle or Square shape. This is different from an interface in that the abstract class can have some code where the interface cannot. 4. Polymorphism allows you to pass different types to a function that takes a higher type. For example, you could have an ArrayList of Shapes or List<Shape> as an argument to a function. That list could really be some Rectangles, some Triangles, some Squares, etc. The function would only know how to work with a Shape, which is common to all. Rule of thumb? Some books have checklists that help you narrow it down. Sometimes experience is the best key. Luckily, it's sometimes easy to change your mind later if you want. So if you started with an interface and find yourself putting the same code everywhere, maybe you want an abstract class. Pick up the "Refactoring" book by Martin Fowler. I guarantee it will help out, once you start coding with OOP (or not!). -ner