|
Blizzardice wrote: Do I have to put something in the get set properties? I implemented another item and put return new item for the get that called that item. But the rest I left blank.
Most likely, yes. Those properties, if mandated by the Interface, are expecting you to store some information, whatever it is. The Interface is saying that the host app is going to expect to find certain kinds of data in those properties.
Blizzardice wrote: What is the [functionName] purpose of the square brackets?
It's telling the compiler your using a reserved word as a variable name, which would otherwise be illegal.
Blizzardice wrote: Is there a scoring system here where I give you points for answering my posts?
Just the 1,2,3,4,5 in the bottom right corner of each post.
Blizzardice wrote: Public Property Progressor() As ESRI.ArcGIS.esriSystem.IProgressor Implements ESRI.ArcGIS.esriSystem.ITrackCancel.Progressor
Get
Return New MyProgressor
End Get
Set(ByVal value As ESRI.ArcGIS.esriSystem.IProgressor)
End Set
End Property
I don't know what you asking here. From this little piece of code, it looks like this property is returning a new instance of an object that implements IProgressor , on every call to the property. This can get out of control very rapidly. EVERY SINGLE call to this property would create a new instance, NOT returning the same instance that was help before. If you've not a pro at this, using a technique like this can lead to some nasty problems to debug.
Normally, you wouldn't use a property to do this. Normally, you use a shared factory method in a class to create new instances. This is an example of a over simplified factory method:
Public Shared Function CreateProgressor() As IProgressor
Return New MyProgressor
End Function
What you posted looks like a poor-mans implementation of the Factory pattern.
|
|
|
|
|
Hi,
I have a SQL-Server table with columns: ID(integer,identity),Id_Parent(integer,referencing ID), and other fields.
I load the data in a datatable(with a SqlTableAdapter).
1) If I create a new row in the datatable, the Update method works well
2) If I create another row referencing the previous before updating (and so without an ID), I cannot save it.
Probably I have to retrieve the @@IDENTITY field from the database, but I would like to use only one update action.
Any ideas ???
Peace!
|
|
|
|
|
You have no choice but to do this in TWO actions. It's impossible to do in one.
|
|
|
|
|
Hi,
Is it possible to unzip a winzip or pkzip file with the sharpzip library. If so, where can I find examples?
jthomas
|
|
|
|
|
Does anyone know how to create the Select All function under the Edit menu in vb.net? I need to be able to select all items in a listbox.
jds1207
|
|
|
|
|
For i As Integer = 0 To ListBox1.Items.Count - 1
ListBox1.SetSelected(i, True)
Next i
SetSelected also allows you to deselect an item by setting the boolean parameter to false
|
|
|
|
|
How can I retrieve the list of IP Addresses, and the Names of the Computers connected in my local area Network.
I want to develop a project which can show me the list of computers connected to the server through vb.net.
Please Help me.
Sekhar
|
|
|
|
|
|
hi my name is Vuyiswa, i have the Following Problem
.
am using vb.net in vs2003. i have written an dabase application.i have knowledge of ADo.net and i have created my connection and droped the table on my form and generated the dataset. now when i add the new row to the dataset, it complete the process and be succsessfull, here is the code
<br />
'save the New Record for an Add or Edit<br />
If mblnAdding Then<br />
Try<br />
Dim newRow As DataRow = DataSet11._PROPERTY.NewRow<br />
newRow("Num_key") = txtnumkey.Text<br />
newRow("Extension") = txtextension.Text<br />
newRow("Cell_ID") = txtcellid.Text<br />
newRow("ACTUAL_EXTENT") = txtactualextent1.Text<br />
newRow("Lis_key") = txtliskey.Text<br />
newRow("Func_key") = txtfunckey.Text<br />
newRow("PROP_CATEGORY_ID") = txtcategoryid.Text<br />
newRow("Geocode") = txtgeocode.Text<br />
DataSet11._PROPERTY.Rows.Add(newRow)<br />
<br />
Catch exc As Exception<br />
MessageBox.Show("Unable to add the Record." & _<br />
ControlChars.NewLine & exc.Message, "Property")<br />
<br />
End Try<br />
mblnAdding = False<br />
lblRecordNumber.Text = "Record Added at the end of the Table"<br />
End If<br />
Locktextboxes()<br />
EnableNavigation()<br />
cmdsave.Enabled = False<br />
cmdadd.Text = "&Add"<br />
mblnIsDirty = True<br />
End Sub<br />
and my code is Very well working, i used the Closing Event of the form to update, meaning to save the dataset into the real table so as to reflect the new added row into my table, so i put the Following Code on the closing Event of my form
<br />
Private Sub frmSingle_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
'save the datasource Changes<br />
If mblnIsDirty Then<br />
If MessageBox.Show("Do you want to Save the Changes?", "Property", _<br />
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then<br />
Try<br />
SqlDataAdapter1.Update(DataSet11, "Property")<br />
Me.SqlDataAdapter1.Update(Me.DataSet11, "PROPERTY")<br />
<br />
Catch<br />
MessageBox.Show("Error saving the File", "Property")<br />
End Try<br />
End If<br />
End If<br />
End Sub<br />
Built it and run it ,after i click on the save Button of the first code, it save a new Row in the dataset. now when i try to close the form, it recognises the changes in the dataset and ask me if ai want to save the changes and i say "Yes" and it gives me the Error that used to trap Errors. as you have seen my above Errors, please help me and tell me what is wrong, why doesnt it update my dataset by appending a Row in the tables.
?
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: Try
SqlDataAdapter1.Update(DataSet11, "Property")
Me.SqlDataAdapter1.Update(Me.DataSet11, "PROPERTY")
Catch
MessageBox.Show("Error saving the File", "Property")
End Try
Get rid of the Try/Catch block for now and let the code throw the exception. We need to see the exception messsage to know what it's complaining about. Your code is hiding the exception behind a non-description messagebox that doesn't give any useful information.
|
|
|
|
|
thanks for your Reply Dave. here is the following Error i get when i remove the try and catch
"An unhandled exception of type 'System.Data.SQlClient.SQlException'
occurred in System.data.dll"
Please help
Vuyiswa
|
|
|
|
|
That's not the entire exception. What does the Message property say in that exception?
|
|
|
|
|
Hey
I have an application integrated with Microsoft Outlook 2003. This application also runs Macros in Excel and then saves the workbook. The save can take a reasonable amount of time, so at the moment I bring Excel to the front so the user can see the program hasnt crashed.
This is a bit of a bodge and looks untidy so is there a way to get Excel to notify my application of when it has finished saving?
I though about trying to hook into the Save event and then callback when it has done but I was wondering if there is a simpler way so that I can just implement a progress indicator or another way of telling the user the app is busy.
Thanks
Dan
|
|
|
|
|
I don't see how this is going to work. The Save method in the Excel object is going to be a blocking call, blocking your UI thread(!). So I don't see how you can put up a progress bar and update it while your UI thread is blocked.
|
|
|
|
|
You could use a BackgroundWorker that processes all the information in the background and reports back to your application the progress of the procedure. You would then have a progressbar update with the progress (you might consider a never-ending/repetitive progressbar if you cannot track the time of the save event).
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I recorded an actual Macro and it looks like this.
Application.CommandBars("Web").Visible = False
Range("A28").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("A29").Select
ActiveWindow.SmallScroll Down:=3
What I actually have is thousands of rows populated, Three rows are visible with data in the top three rows of my active sheet, 26, 27 & 28 in this example.
When I first open the spreadsheet, I need to make the WEB toolbar go away, this part is good.
I then need to click on the very last hyperlink in 'A' column, I think it may be refered to something like lastused range????? This example is 'A28'.
I then need to put the cursor in the next available empty cell past the lastused range in the 'A' column and post it in the very top left corner, (as though it was in cell A1 ready to work).
This empty cell was in the fourth row so I did three smallscroll to get it to the top row in view.
When I record the macro as you see above it records the actual cell number, this will not help me but I know someone here can please.
I also need the macro to run slowly giving the internet time to upload the hyperlink and then revert back to finish the macro, it just zips right through it now and does not end up in the correct cell when completed.
Thanks in advance for any help, I didnt see a VBA forum, flame suit on.
Lastly, is there a way to make the WEB toolbar stay gone, it wasnt in view by default prior to some MS update I am guessing???
|
|
|
|
|
As I have said before I have textboxes bound to the DataGridView. When the user updates a value I have them click on a "Save" button where I get the values that find the row from the current row in the DataGridView and then call Row.BeginEdit, set the values, then call Row.EndEdit.
Only after sorting will the row change event occur (I am verifying this by checking for BindingSource.PositionChanged) and it only happens if I change the value within the sorted column and when it changes rows the row it changes to gets that single changed value.
This is so strange and Im not sure what to do about it.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Let's see the code that's making the changes. Why are you setting the values in the data in code? Why not just bind theTextBox to the fields?
|
|
|
|
|
Dave Kreskowiak wrote: Why are you setting the values in the data in code? Why not just bind theTextBox to the fields?
They are bound but I guess Im not sure how to apply those changes except for changing rows.
Dim searchKeys() As String = {value1, value2, value3}
Dim updateRow As DataRow = DsCirculars1.tblAPCirculars.Rows.Find(searchKeys)
Try
With updateRow
.BeginEdit()
.Item("FirstName") = uxFirstName.Text
.Item("LastName") = uxLastName.Text
.Item("Address") = uxAddress.Text
.Item("City") = uxCity.Text
.Item("State") = State.Text
.Item("ZipCode") = uxZipCode.Text
.EndEdit()
End With This does work when there is no column sorted and only causes the row to change if I change a value that is within that column.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
OK. If the datagrid and the textboxes are both bound to the dataset in the same binding context, you don't need any of this code.
All it takes is something like this:
'
' Code to connect to database and fill a DataTable, or DataSet.
'
' Setup the bindings...
BindingSource1.DataSource = myDataTable
DataGridView1.DataSource = BindingSource1
SomeTextBox1.DataBindings.Add("Text", BindingSource1, "SomeColumnName")
SomeTextBox2.DataBindings.Add("Text", BindingSource1, "SomeColumn")
SomeTextBox3.DataBindings.Add("Text", BindingSource1, "OtherColumnName")
That's it, no other code to set anything really. Unless you're doing something that isn't so straight forward??
|
|
|
|
|
Dave Kreskowiak wrote: That's it, no other code to set anything really. Unless you're doing something that isn't so straight forward??
Im not doing anything that isnt straight forward but when the user types into the textbox, without moving to another row how is the data refreshed and saved without doing something like I did?
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
So long as the textbox's are bound in the same binding context, managed by the bindingsource) as the datagrid, you don't have to do anything. It happens automatically!
Try it! Start a new project. Create a form with a DGV and a couple of textboxs on it and add a bindingsource object to the form. Write some SQL to fill a datatable with a few columns of data and bind the BindingSource to the DataTable. Bind the DGV and the TextBox's to the BindingSource, like in my previous post, and try it! It might just surprise you.
|
|
|
|
|
I have Edit mode and Add mode, when the user chooses Add mode I clear the textbox bindings and when the user chooses Edit mode I use the following code.
uxFirstName.DataBindings.Add("Text", BindingSourceCirculars, "FirstName", True)
uxLastName.DataBindings.Add("Text", BindingSourceCirculars, "LastName", True)
uxAddress.DataBindings.Add("Text", BindingSourceCirculars, "Address", True)
uxCity.DataBindings.Add("Text", BindingSourceCirculars, "City", True)
uxState.DataBindings.Add("Text", BindingSourceCirculars, "State", True)
uxZipCode.DataBindings.Add("Text", BindingSourceCirculars, "ZipCode", True)
Unless I choose the find the row and edit it, nothing in the DataGridView changes until I change rows in the grid. Am I missing something? Binding seems to be much more complicated in 2.0 than it EVER was in 1.1 and I cant seem to find the information I need in order to make this work the way I want it to.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Is the real trick here to just call BindingSource.EndEdit in order to have that change applied if I am trying to have the user push a "Save" button for familiarity purposes?
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Did ya try it? It's very possible that's all it's going to take. On top of that, maybe refreshing the DGV.
|
|
|
|
|