Jump to content
Xtreme .Net Talk

Machaira

Avatar/Signature
  • Posts

    330
  • Joined

  • Last visited

Everything posted by Machaira

  1. You don't need to know about the row state of the rows in your datatable. Let .NET handle it. Use a DataAdapter: Dim da As New SqlClient.SqlDataAdapter("SELECT * FROM Users", conn) Dim dt As New DataTable Dim cmd As New SqlClient.SqlCommandBuilder(da) da.InsertCommand = cmd.GetInsertCommand da.DeleteCommand = cmd.GetDeleteCommand da.UpdateCommand = cmd.GetUpdateCommand da.Fill(dt) 'do stuff to datatable da.Update(dt)
  2. I don't see where you have GROUPTYPE in the WHERE clause in your query so why have a parameter for it.
  3. Something like: Dim dt As New DataTable Dim iLp, ilp2 As Integer 'assumes you've filled the datatable For iLp = 0 To dt.Rows.Count - 1 For ilp2 = 0 To dt.Columns.Count - 1 dt.Rows(iLp).Item(ilp2) = Decrypt(dt.Rows(iLp).Item(ilp2)) Next ilp2 Next iLp dt.AcceptChanges() 'bind to controls
  4. What OS is the user running? It doesn't look like there's anything on MSDN about this, at least not that I could find with a quick search.
  5. Unless I've missed something, .NET doesn't know anything about the non-data portions of Access databases. You'd probably have to use an Access object in your application to get to them.
  6. You can always roll your own or use a 3rd party one like - http://www.codeproject.com/vb/net/SPB.asp
  7. Why are you hiding the buttons? Can you just disable them?
  8. Try the CurrentCellChanged event
  9. You got it. You're just changing a copy of the data and not the actual data itself.
  10. thousands of sounds at once != 300 :) I'll have to take a look at it though.
  11. Slight exaggeration there?! :-\ :)
  12. Why not just do something like: If buttonpanel.Top > -(buttonpanel.Height - 151) Then 'allow scrolling End If You shouldn't even need to worry about how many buttons there are, just the size of the panel that contains them.
  13. That line is fine. If you need to convert that code to a Windows program, you need to use another method to get the input from the user (for example - display a form with a textbox and use the text in the textbox as the parameter to ConvertStringToByteArray) instead of using the Console class.
  14. You handle the event in the the context menu item's Click event, just like you would a normal menu item.
  15. Here's a version that works: Imports System Imports System.Windows.Forms Imports System.Runtime.InteropServices Public Class Win32Interop Public Const WM_USER As Int32 = 1024 Public Const PBM_SETMARQUEE As Int32 = (WM_USER + 10) Public Const GWL_STYLE As Int32 = -16 Public Const PBS_MARQUEE As Int32 = 8 <DllImport("user32.dll", EntryPoint:="GetWindowLong")> _ Public Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Int32) As Int32 End Function <DllImport("user32.dll", EntryPoint:="SetWindowLong")> _ Public Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32 End Function <DllImport("User32", SetLastError:=True)> _ Public Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32 End Function End Class Public Class Form1 Inherits System.Windows.Forms.Form Private _pb As Windows.Forms.ProgressBar #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call Application.EnableVisualStyles() Application.DoEvents() _pb = New Windows.Forms.ProgressBar _pb.Dock = Windows.Forms.DockStyle.Fill Width = 500 Height = 50 Controls.Add(_pb) Dim i As Int32 = Win32Interop.GetWindowLong(_pb.Handle, Win32Interop.GWL_STYLE) Win32Interop.SetWindowLong(_pb.Handle, Win32Interop.GWL_STYLE, i Or Win32Interop.PBS_MARQUEE) Win32Interop.SendMessage(_pb.Handle, Win32Interop.PBM_SETMARQUEE, 1, 100) End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container Me.Text = "Form1" End Sub #End Region End Class
  16. Nope, they're in SqlClient. The "*" appears to only include the namespaces at that level, not the classes in those namespaces.
  17. The class already has its own Sub Main, you don't need to add another one, just tell the app to use the class's. When the app runs it should prompt you for the location of the Sub Main.
  18. I thought you were using J#. I've never used it so I was taking a shot in the dark. How about: import System.Data.SqlClient.*;
  19. OK, after looking at this it appears you probably aren't using this in a Console Application project. Create a new Console Application project and try the code.
  20. What happens if you change your import to: import System.Data.SqlClient;
  21. Sure. Load the xml file into a string and use the Replace method: String.Replace("xmlns","xmlns:ns")
  22. I think you could probably do with using a datagrid. It wouldn't be the prettiest in the world, but it would probably work. Attached is a sample project and SQL to create the tables I used. I used SQL Server, but MySQL would work nice if you can't afford SQL Server (pretty expensive I believe)Scheduler.zip
×
×
  • Create New...