|
wwb posted:Yes, and a virtual directory not under the production site. Main reason for this is that .NET configuration "flows" downhill, so you will end up with lots of tweaking required to get your configuration working. It could also negatively effect your running app domain. Finally, it is bad form to munge production and testing applications no matter how many times Google rolls out public betas. Ok - So in that case, I should put up the test site on a completely different domain from the "live" site, and only after it is all approved XCOPY it onto the original domain. The test site and the live site should never coexist on the same domain. Thanks once again for the help. This probably has been mentioned before, but SH/SC beats every other technical forum I have used for speed and quality of advice.
|
# ? Jul 9, 2007 01:24 |
|
|
# ? Jun 10, 2024 09:10 |
|
Nuts, no one else knows why my form mysteriously lost all of its controls, but all the code is still there and the designer file is intact (all of the controls are still declared and instantiated in it)?
|
# ? Jul 9, 2007 04:02 |
|
Nurbs posted:Nuts, no one else knows why my form mysteriously lost all of its controls, but all the code is still there and the designer file is intact (all of the controls are still declared and instantiated in it)? I think this happened to me once when the resx file got corrupt somehow. Otherwise all I can think of is a container or something accidentally got visible=false, or with coordinates set off-side.
|
# ? Jul 9, 2007 13:40 |
|
SLOSifl posted:What licensing issues are preventing you from using SQL Server Compact Edition, exactly? Things would probably be much easier if you used it. SQL Server CE (compact, not the legacy 'CE') is freely redistributable and doesn't require individual licenses. I have brought this up many times with my supervisor, and he is still against using SQL server CE. He thinks it is going to be a waste of resources on the Pocket PC's. Edit: Also, data synchronization requires a web service on the host computer. Something else I'm not allowed to implement. Shayla fucked around with this message at 13:49 on Jul 9, 2007 |
# ? Jul 9, 2007 13:46 |
|
Nostromo_ posted:Ok - So in that case, I should put up the test site on a completely different domain from the "live" site, and only after it is all approved XCOPY it onto the original domain. The test site and the live site should never coexist on the same domain. Bingo. Well, not really domain so much as same environment. But you get the picture.
|
# ? Jul 9, 2007 14:39 |
|
I'm having some issue when trying to move a file to another location. I have this snippet of code here:code:
Now, I'm getting a confusing exception message when trying to call File.Move, which reads, "IOException was unhandled: The process cannot access the file because it is being used by another process." I'm not sure what is using the file I'm trying to move. For right now, to test the program, I'm copying the file from my desktop to a temporary directory, in which I want to move to another temporary directory. Is it possible that the copying process isn't finished by the time the flow of execution reaches the File.Move() call? I would think the copying process finishes before the event handler even executes, so... Any help is appreciated, thanks as usual!
|
# ? Jul 9, 2007 21:50 |
|
I'm trying to use the XmlSerializer to serialize a list of objects. Each object in my list will be either be a built in type ( string, int, double, bool, etc ) or a list of built in types. I'm having trouble if I define my main list as a List<object> - when saving I get the following exception - "The type System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] may not be used in this context." I've gotten it to work if I define a base type for the items in my list and then derive new types for each possible type that can be saved. I don't really like this method and was hoping there might be a better way to accomplish this. code:
|
# ? Jul 9, 2007 21:58 |
|
Why doesn't this work?code:
|
# ? Jul 9, 2007 22:01 |
|
pliable posted:I'm having some issue when trying to move a file to another location. I have this snippet of code here:
|
# ? Jul 9, 2007 22:05 |
|
genki posted:I think we need more information to really determine where the issue is. The code as presented should work ok, afaict. code:
|
# ? Jul 9, 2007 22:21 |
|
pliable posted:
If you ran that code on a file that's existing and just sitting there, it would work fine (I think). There should be a way to monitor the file and move it when it's not in use... I don't know how off the top of my head, but some googling would probably have a way.
|
# ? Jul 9, 2007 22:32 |
|
pliable posted:
First off, there are built-in methods to make your life easier wrt the renaming stuff you're doing: code:
edit: genki posted:Oh wait, are you watching the directory and running this event when a file is created? I would wager that whatever is creating the file is doing so before the file is actually written. For example, WinRAR creates the archive then appends to the file. So it's possible the file isn't available for copying/moving when the event is fired. This is also likely.
|
# ? Jul 9, 2007 22:35 |
|
Nurbs posted:Nuts, no one else knows why my form mysteriously lost all of its controls, but all the code is still there and the designer file is intact (all of the controls are still declared and instantiated in it)? This sounds close to what happens when you have databound controls and a designed dataset, and then you change the dataset. But in that case you should get an error message I think, and it is solved by just closing the form and opening it again. Other possibility I can think of is also with databound controls, when the column name in a datagrid is the same as something else. But that should also give an error message somewhere. Don't you get a message somewhere ? And does it still compile ? Or run ?
|
# ? Jul 9, 2007 22:54 |
|
salithus posted:Why doesn't this work? I think you need to add a dataGridView1.DataBind(); command. (Sidenote: I think you don't need to open or close the connection if you're using a dataAdapter. It doesn't hurt, but it's not needed, the adapter takes care of it.)
|
# ? Jul 9, 2007 22:57 |
|
Is there anything that can create a DAL and business objects for me? One thing that turns me totally off to programming in C# is all the repetitive crap in dealing with a database. I'd prefer to have something thats GUI driven and doesn't require me to learn some oddball scripting language.
|
# ? Jul 9, 2007 23:18 |
|
Safrax posted:Is there anything that can create a DAL and business objects for me? One thing that turns me totally off to programming in C# is all the repetitive crap in dealing with a database. I'd prefer to have something thats GUI driven and doesn't require me to learn some oddball scripting language. You mean something like this? edit: Or something like this, maybe?
|
# ? Jul 9, 2007 23:27 |
|
Munkeymon posted:You mean something like this? Last time I looked at nHibernate it used a scripting language of some sorts so no.. doesn't fit the bill. XPO might work. Any other recommendations?
|
# ? Jul 9, 2007 23:47 |
|
genki posted:Oh wait, are you watching the directory and running this event when a file is created? I would wager that whatever is creating the file is doing so before the file is actually written. For example, WinRAR creates the archive then appends to the file. So it's possible the file isn't available for copying/moving when the event is fired. Basically. I'm keeping an eye on a directory, and when something is created in that directory, OnCreated() fires off and gets the name and etc etc. This code needs to be run on an empty directory; the file will not exist there before the program is run. If there is a file, then , poo poo will hit the fan (but I won't be to blame). csammis posted:First off, there are built-in methods to make your life easier wrt the renaming stuff you're doing: I knew there had to be a much easier way to do that, thanks a ton! Now, as for stopping it for a few seconds...where can I do that? Here is the main program: code:
|
# ? Jul 10, 2007 00:05 |
|
fankey posted:I'm trying to use the XmlSerializer to serialize a list of objects. Each object in my list will be either be a built in type ( string, int, double, bool, etc ) or a list of built in types. I'm having trouble if I define my main list as a List<object> - when saving I get the following exception - Just a guess, but does it work if you define it as List<ISerializable> ? (I mean, presumably the problem is either that List<> isn't serializable, or that Object isn't serializable.)
|
# ? Jul 10, 2007 00:07 |
|
ljw1004 posted:Just a guess, but does it work if you define it as List<ISerializable> ?
|
# ? Jul 10, 2007 00:29 |
|
Safrax posted:Is there anything that can create a DAL and business objects for me? One thing that turns me totally off to programming in C# is all the repetitive crap in dealing with a database. I'd prefer to have something thats GUI driven and doesn't require me to learn some oddball scripting language. And what do you want this for? If you're going to be prototyping, I like http://db4o.com as something I can just throw in and have work, but depending on your needs, that's not going to work. And what do you mean, GUI driven?
|
# ? Jul 10, 2007 01:03 |
|
pliable posted:Now, as for stopping it for a few seconds...where can I do that? Stick "using System.Threading;" at the top and "Thread.CurrentThread.Sleep(int)" wherever you want to stop processing for however many ms
|
# ? Jul 10, 2007 01:05 |
|
pliable posted:Now, as for stopping it for a few seconds...where can I do that? Here is the main program: Depending on how this program is supposed to function and what the program writing the files does, this may or may not work. Basically, in the OnCreated event, you'd have a structure like: code:
code:
It's not an elegant solution, but based on what you need, this might be the only way...
|
# ? Jul 10, 2007 01:12 |
|
genki posted:I don't really get what you're asking for. Is there an existing example that does what you want? What I'd like is to be able to either with a graphical or with a pre-existing class that I have generate the DAL and all the database crap for me. I just provide basically the ConnectionString, the classes, and it can take care of the rest. nHibernate is close to this. And from what I just found, http://www.subsonicproject.com/, seems to be really close minus the GUI. I'm going to take a close look at SubSonic and if that doesn't work, MonoRail.
|
# ? Jul 10, 2007 01:29 |
|
pliable posted:Now, as for stopping it for a few seconds...where can I do that? I hate FileSystemWatcher. It does EXACTLY what it's told to do, which is pretty useless for what most people want it to do. It is firing the created event when the file is created, but whatever application created that file is still in the process of writing it. Yes, you could sleep a couple seconds and hope that gives it enough time to finish up, but what if it doesn't? Or you can hack a while loop and catching the exceptions that are raised when you try to move it. But those exceptions can be awful expensive. When I had to do it, I had to determine if a file was created, modified, or deleted, and act accordingly. I ended up with two threads, one running FileSystemWatcher and pumping descriptions of the various events into a queue, and other checking that queue and making sure no events had happened for the same file within the last 5 seconds before actually doing something. It was made even worse by the way MSOffice doesn't actually save over a file, it creates a temp file, saves to it, deletes the original, then renames the temp (or something like that). I hate FileSystemWatcher. It had me so excited when I started .NET, and hurt me so bad.
|
# ? Jul 10, 2007 01:57 |
|
Safrax posted:What I'd like is to be able to either with a graphical or with a pre-existing class that I have generate the DAL and all the database crap for me. I just provide basically the ConnectionString, the classes, and it can take care of the rest. nHibernate is close to this. And from what I just found, http://www.subsonicproject.com/, seems to be really close minus the GUI. I'm going to take a close look at SubSonic and if that doesn't work, MonoRail. It is based on nHibernate, but I think it makes it a bit easier.
|
# ? Jul 10, 2007 02:04 |
|
@Safrax: Subsonic is probably the best ORM option out there today. LINQ2SQL and the Entity Framework for .NET 2008 (or whatever they are calling it) look very promising, but they are not quite here yet. That said, I have tried and tossed alot of ORMs. They just don't cut the mustard, unless you want to compromise seriously on database or object layer design. The Entity Framework looks like it is as close to getting it right as anything, but I would bet one will fall all to easily into the ActiveRecord style trap there too. PS: I am watching Hibernate bring one of my database servers to its knees. Hibernate is an evil, evil thing that should not be let near production. wwb fucked around with this message at 12:55 on Jul 10, 2007 |
# ? Jul 10, 2007 04:43 |
|
Dromio posted:I hate FileSystemWatcher. It does EXACTLY what it's told to do, which is pretty useless for what most people want it to do. http://www.nirsoft.net/utils/opened_files_view.html This is a utility that lists file in use. It apparently uses windows APIs to do this. Maybe something like this will help ? It's probably a lot more work than just catching exceptions and letting your program wait a bit though.
|
# ? Jul 10, 2007 08:58 |
|
uXs posted:I think you need to add a dataGridView1.DataBind(); command. dataGridView1.DataBind(); gives me: quote:Error 1 'System.Windows.Forms.DataGridView' does not contain a definition for 'DataBind'
|
# ? Jul 10, 2007 12:24 |
|
salithus posted:dataGridView1.DataBind(); gives me: You're right, that doesn't exist. I'm checking some code here and it seems that I'm using a BindingSource as an intermediate step. Try something like this: BindingSource binding = new BindingSource(); binding.DataSource = yourDataTable; yourDataGridView.DataSource = binding; Failing that, try to give the table an explicit name, bind the bindingsource to the dataset instead of the table, and set binding.DataMember to that tablename. I don't think it's that, but that's the only other difference I'm seeing between my code and yours.
|
# ? Jul 10, 2007 13:21 |
|
This is probably a really simple one, but here goes: I have a asp.net page with a drop down list which works fine. I also have a couple of forms on the same page which allow you to submit stuff, which also works. I then have some RequiredFieldValidators which work fine with the input for but this means I can't use my drop down list control on the same page as the RequiredFieldValidators kick in. Is this possible or do I have to move one of them to a seperate page?
|
# ? Jul 10, 2007 15:05 |
|
Vedder posted:This is probably a really simple one, but here goes: set CausesValidation = false
|
# ? Jul 10, 2007 15:27 |
|
havelock posted:set CausesValidation = false Just to be double sure I assume that goes on the drop down list? Edit: I am being a retard today. The button that controls the drop down list! Thanks.
|
# ? Jul 10, 2007 15:41 |
|
uXs posted:You're right, that doesn't exist. Still not working for me. Oh well, I'll work around it. Another question: Why doesn't private void cbxProductList_SelectedIndexChanged(object sender, EventArgs e) fire for cbxProductList.SelectedIndex = 0;?
|
# ? Jul 10, 2007 17:19 |
|
salithus posted:Why doesn't private void cbxProductList_SelectedIndexChanged(object sender, EventArgs e) fire for cbxProductList.SelectedIndex = 0;? Is the selected index already 0?
|
# ? Jul 10, 2007 18:50 |
|
csammis posted:Is the selected index already 0? Um...good question. Turns out you're right. Is there a better way to do it than this? code:
|
# ? Jul 10, 2007 18:53 |
|
salithus posted:Um...good question. Turns out you're right. Is there a better way to do it than this? If you're just trying to force the event to fire, call the method directly code:
|
# ? Jul 10, 2007 18:56 |
|
efb;salithus posted:Still not working for me. Oh well, I'll work around it. Try setting the <Binding Instance>.UpdateSourceTrigger as in: code:
Maybe SelectedIndex was already 0 and it's smart enough not to raise a changed event when it doesn't actually change?
|
# ? Jul 10, 2007 19:01 |
|
Munkeymon posted:efb; That shouldn't be necessary. You basically set the datasource to the datatable and that's it. Maybe it's because you didn't define any columns ? I don't know why it doesn't generate them automatically though, it should do that.
|
# ? Jul 10, 2007 19:12 |
|
|
# ? Jun 10, 2024 09:10 |
|
uXs posted:That shouldn't be necessary. You basically set the datasource to the datatable and that's it. The DataGridView is working now. I realized I hadn't rebooted since last week Thanks for the pointers though. Is there a cleaner approach to what I'm doing though? I've got a listbox of products, and when I select a product, I want it to populate the datagrid. When the app loads, it's populating the product list and starts with the first one selected, so it should have that product line's data populated, but forcing the "SelectedIndexChanged" event seems too forceful.
|
# ? Jul 10, 2007 20:02 |