Jump to content
Xtreme .Net Talk

Robby

Moderators
  • Posts

    3848
  • Joined

  • Last visited

Everything posted by Robby

  1. Here's an example of a dynamic connection string... Dim strSQL As String = "SELECT * FROM SomeTable" Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" & Application.StartupPath & "\myDatabase.mdb") Dim cmd As New OleDbCommand(strSQL, cn) Dim da As New OleDbDataAdapter(cmd) Dim ds As New DataSet() da.Fill(ds, "SomeTable") With DataGrid1 .DataSource = ds.Tables(0) .Visible = True End With
  2. What does your dynamic connection string look like?
  3. Is this a rhetorical question, are you just making an observation?
  4. You got it exactly.
  5. Use a member boolean variable (form level) and and set it to true once the DG has been clicked for the first time. All this is because CurrentCellChanged and Click (or Enter) will all fire each time you click the grid, so you need to determine the very first time it's clicked.
  6. You can use ... ComboBox1.SelectedText = "xxx" ' visible text 'or ComboBox1.SelectedValue = "xxx" 'item that bound it, usualy ID column
  7. You can use the Enter or Click event of the DG to check for the first time you click it. You will need to set a flag to determine this.
  8. Happy Birthday Nerseus We almost forgot. :D :eek: :D :eek:
  9. Initialize them to -1
  10. Does custDS contain the corect table name?
  11. Have you attempted the same thing without the 30 minute delay?
  12. Fadi, that's exactly what Cassio has in his first post.
  13. place this in the CurrentCellChanged event of the dg... dim myCellValue as string= CType(myDatagrid.Item(myDatagrid.CurrentRowIndex, 0), String) 0 is the column number
  14. Nope.
  15. Are you in Debug mode when this happens? Either way the first time you run a .NET app it is always slower.
  16. Same if you start a new sentence in lower case.
  17. Is it firing? If it is then do this dg.EditItemIndex = e.Item.ItemIndex OR DirectCast(source, DataGrid).EditItemIndex = e.Item.ItemIndex
  18. Actualy it can be done.... You can even soft-code the table or column names if needed. declare @MyTop as int set @MyTop=20 declare @Sql varchar(1000) DECLARE @Crlf NCHAR(2) SET @Crlf = CHAR(13) + CHAR(10) set @Sql = 'BEGIN TRANSACTION' + @Crlf + 'select top ' + @MyTop + ' * from MyTable' + @Crlf + 'COMMIT TRANSACTION' + @Crlf Begin transaction exec (@Sql) commit transaction
  19. If your process is in a loop you can place an Application.DoEvents, this will allow the cancel to be clicked, be careful because all the controls are clickeable during this time so you should disable them until the process completes. There are two ways of handling the above approach... 1) Set a flag before going into the function and check the status of the flag on each iteration. The cancel button would change flag status so the next time it loops you would be able to cancel. 2) Use Threading
  20. It's cheaper to buy a new keyboard then paying to develop a silly program like that. :)
  21. samsmithnz, the point of the link I provided was to show you that there is a known issue!
  22. Robby

    msgbox

    Tate, since this is in the ASP.NET section and everyone is suggesting options using Javascript, my bet is that MessageBox will not work.
  23. you would have to remove the Like and the single quotes. sb.Append(dc.DataField + " = " + dc.FilterText )
×
×
  • Create New...