You might want to check the .NET Code Access Security policies on the production server.
david cohoon
Posts
-
Help - I ‘m getting a .NETapp installation error (urgent) -
Datasets & RowStatesIf you want the rows to remain as MODIFIED, do not call AcceptChanges(). By calling AcceptChanges() you are commanding the data row(s) to end the current edit.
-
User Control MouseEnter MouseLeave ProblemsYou could override the WndProc() method of the control to ignore the message.
-
ADO.NET - Best way to use the mighty SELECTThere are many different ways of ensuring that the rows are not modified while you are accessing them. But, let me ask you first - is it feasable that the data in the db can be altered by means other than your application? Ensuring optimitic locking inside your application only works if everyone is using your application to access the data. If others might have access to the data outside of your application, you'll most likely want to push all your updates into a transaction and set the isolation level accordingingly.
-
query datasetYou can use the Select() of a datatable...
// create and populate a dataset DataSet ds = new DataSet(); DataTable table = ds.Tables.Add(); table.Columns.Add("Name", System.String); table.Columns.Add("Value", System.String); table.Rows.Add(new string[] {"David", "one"}); table.Rows.Add(new string[] {"George", "two"}); // call DataTable.Select() to get all rows with name starting with 'D' DataRow[] resultRows = table.Select("Name Like 'D%'");
Hope it helps! -Cursor -
C# MDI parent form & mdi form childs questions...urgent help please!Instead of creating a new FORM2 everytime when the button is clicked, create a member variable of type FORM2 in FORM1, initializing it to null. In the event handler, test against null before creating the second form.
public class FORM1: System.Windows.Forms.Form { private FORM2 _secondForm = null; private void btnOk_Click(object sender, System.EventArgs e) { if (this._secondForm == null) { this._secondForm = new FORM2(); this._secondForm.MdiParent = this.MdiParent; } this._secondForm.Show(); } }
This is just a simple fix, usually I try to have my mdi container manage my form instances. In regards to your question regarding the second form accessing the first's textbox text, you could have the first form pass the second form a reference to itself. Again, this is much cleaner by having the MdiContainer manage interactions between child forms. -cursor -
Refresh formsDepending on whether the data on the second form is related to the data on the first form, you could pass the first form's binding context to the second form, so that both forms use the same binding context. I've done this when I had to display child data in a separate form. I just passed the binding context into the second form's constructor. There are several different ways to detect whether a form is already currently being shown. One way is to create your own ApplicationContext and have it create and destroy your forms. Another way is to simply create a static object that holds this information. Hope that helps