Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Changing the declaration to single rather than integer doesn't alter the fact that the under-lying API still uses integers. You are just slightly changing the rounding error.
  2. try the following... Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click Dim DLL As New Dll_Test_Dll.Class1 'change this line MsgBox(DLL.Bob(1, 2)) End Sub
  3. If you add a web reference to a web service .Net should also generate an Async wrapper round the call. e.g. If the web ervice had a method Test you would also get a BeginTest / EndTest that can be used to call a web method asyncronously (sp?) If you have a particular service in mind reply and I could suggest some code. PS. Bucky - love your sig :D
  4. Create the project as a class library or a windows control library
  5. Don't inherit from a control, inherit from Component
  6. Pasting your code in I don't get any errors with regards to but I didn't expect to. Not having your DB I can't test this but I really don't know why you got that error.
  7. You can add them to the tabpage's controls collection. Dim tp As New TabPage() TabControl1.TabPages.Add(tp) tp.Text = "My New Page" Dim t As New TextBox() tp.Controls.Add(t) t.Location = New Point(100, 100) just adds a single tab and a single control to the page but you should get the idea from it.
  8. try changing the update and command handlers so they include the handles keyword (see below). Couldn't test the code though as the bit you posted doesn't contain a variable called cmdSQL or a function called BindDataGrid. Sub dgrdDivision_EditCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs) Handles dgrdDivision.EditCommand dgrdDivision.EditItemIndex = e.Item.ItemIndex End Sub Sub dgrdDivision_UpdateCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs) Handles dgrdDivision.UpdateCommand Dim txtDivisionCode As TextBox Dim txtDivisionName As TextBox Dim strDivisionCode As String Dim strDivisionName As String Dim conn As SqlConnection = openDatabase() txtDivisionCode = dgrdDivision.DataKeys(e.Item.ItemIndex) txtDivisionCode = e.Item.Cells(0).Controls(0) txtDivisionName = e.Item.Cells(1).Controls(0) strDivisionCode = txtDivisionCode.Text strDivisionName = txtDivisionName.Text strSQL = "Update DivisionCode Set DivisionCode=@DivCode, " _ & "DivisionName=@TrackingDivisionName Where DivisionCode=@DivisionCode" cmdSQL = New SqlCommand(strSQL, conn) cmdSQL.Parameters.Add("@DivisionCode", strDivisionCode) cmdSQL.Parameters.Add("@DivisionName", strDivisionName) openDatabase() cmdSQL.ExecuteNonQuery() closeDatabase(conn) BindDataGrid() dgrdDivision.EditItemIndex = -1 End Sub
  9. Either attach the zipped source here (remove the .exe files though) or PM me with the code and I'll have a look as soon as I get a bit of spare time.
  10. you may want to have a look at Divil's Site for some nice controls
  11. Would the following not work? 'No need to display the form every time through loop Dim stai As New wait stai.TopMost = True stai.Show() oCP.Write(Encoding.ASCII.GetBytes("D" & Chr(13))) Do Until verifica_mesaj() = True If output.EndsWith("F") Then Exit Do End If Application.DoEvents() Loop oCP.Write(Encoding.ASCII.GetBytes("F" & Chr(13))) stai.Close()
  12. Not sure what you are asking here - what do you want the add function to do? Also what data type should it return? If you want a new fraction with the number and denominator totalled then the following should work Public Function add(ByVal frac1 As fraction, ByVal frac2 As fraction) 'How do I pass the numerator and denominator of each fraction?? Dim tmp As New fraction() tmp.numerator = frac1.numerator + frac2.numerator tmp.denominator = frac1.denominator + frac2.denominator Return tmp End Function
  13. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=83092 send your thanks and monetary donations to Bucky :D
  14. Could you show some code? It sounds like you are not setting a variable to a valid instance of an object...
  15. If you are using the setup tools that come with Visual Studio to create a Setp package (.msi file) then it should also provide an uninstall routine - look in control panel -> add remove programs
  16. Is this a windows or web app? If windows then in the Catch bit do something like Catch ex as exception MessageBox.Show(ex.tostring()) end try if a web app then just display ex.ToString on a label on the webpage to see the error.
  17. Depends on what you want to do if an error occurs. I'm fairly sure that you don't want to be doing Throw ex though - you may as well not bother with the try ... catch if you are simply going to generate the same error. What do you want to do if an error occurs?
  18. Just create a new project and add the file to it.
  19. ;) Drag and drop creation of Connections and DataAdapters. Wizard based configuration of DataAdapters (including auto generation of stored procedures). Graphical XSD designer. Design-time data binding of controls.
  20. insteam of implementing IComparer try using IComparable, delete the implements statement and your Compare function and paste this in it's place and see if it works. Implements IComparable Public Function CompareTo1(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo Dim x As clsItem = DirectCast(obj, clsItem) If ItemKey > x.ItemKey Then Return 1 If ItemKey < x.ItemKey Then Return -1 Return 0 End Function
  21. It should have been either Bitmap b = new Bitmap(@"c:\bitmap1.bmp"); or Bitmap b = new Bitmap("c:\\bitmap1.bmp"); in C# (like other C based languages \ denotes an escape sequence i.e. \t is tab, \n is new line etc) if you really mean to use a tab then \\ is treated as a single tab. If you precede a string with @ then it doesn't escape any \ characters
  22. Any chance you could show the relevant code for this? Creating command and it parameters etc? How is the database schema for this table declared?
  23. Dim ps As New ProcessStartInfo() ps.FileName = "Notepad.exe" 'change to your app Dim p As New Process() p.StartInfo = ps p.Start()
  24. You are calling the showdialog function twice - it will show the dialog twice. Use If OpenFileDialog1.ShowDialog () = DialogResult.OK then End if
×
×
  • Create New...