Jump to content
Xtreme .Net Talk

Machaira

Avatar/Signature
  • Posts

    330
  • Joined

  • Last visited

Everything posted by Machaira

  1. You need to write out the whole file. What I would probably do is read the file into an array (each line is an element), change the line then write the array back out to the file.
  2. This might be an easier way: formattext.SelectedText = "<b>" + tmptext.Text + "</b>" :)
  3. I don't understand. If you're using your own objects to handle it, it sounds like you just need to loop through the rows, check the RowState member and apply the correct command.
  4. You can do a switch on the NativeError or SQLState property of the Exception object in your catch block. To my knowledge you can't do a catch on a specific type of error for an Exception type.
  5. Since you've only posted pseudo-code it's hard to tell where the problem is.
  6. Try replacing: cmdBlog.CommandText = qryActiveBlogs; with: cmdBlog = New OleDbCommand(qryActiveBlogs, cnBlog); You also shouldn't need the line: cmdBlog.Parameters.Clear(); since it's a new object the parameters should be empty.
  7. Do a Select with a join on the two tables and export the resulting dataset.
  8. You need to call Update on the DataAdapter I believe.
  9. Try: Dim gr As Graphics = Me.TabControl1.CreateGraphics() Dim rect As Rectangle = Me.TabControl1.GetTabRect(tabNews) gr.DrawImage(New Bitmap(Application.StartupPath & "\Sidekick Files\Program Images\background.jpg"), rect)
  10. Strange. I get the behavior you mentioned when the control is bound to a datasource, but not when I populate the Items collection manually: private void comboBox1_TextChanged(object sender, System.EventArgs e) { MessageBox.Show(this.comboBox1.Text); } private void Form1_Load(object sender, System.EventArgs e) { this.comboBox1.Items.AddRange(new string[] {"Item 1","Item 2","Item 3","Item 4"}); }
  11. Doing comboBox1.DataSource = null; works fine for me.
  12. Why are you using a TextBox for the race? Why not put all the possible races in a ComboBox and do a Select Case on the SelectedIndex of it?
  13. How about using the CommandBuilder to generate the update command: myAdapter = new MySqlDataAdapter(); myData = new DataTable(); MySqlCommandBuilder cb; selSQL = "SELECT * FROM plq.categorias"; try { myAdapter.SelectCommand = new MySqlCommand(selSQL, clsGlobal.dbCon); cb = new MySqlCommandBuilder(myAdapter); myAdapter.UpdateCommand = cb.GetUpdateCommand(); myAdapter.Fill(myData); dG.DataSource = myData; }
  14. Sounds like you need to requery and bind.
  15. I believe HitTest should actually be HitTestInfo.
  16. Set the ImageList and ImageIndex properties for the button instead of the BackGroundImage.
  17. No, it'll work on whatever computer you place the app.
  18. If you have quicktime installed you should have it.
  19. You can use the Text property.
  20. There's a QuickTime COM object, but in my brief testing I wasn't able to get it to work.
  21. Thanks for pointing that out. I guess I should have been more careful with my link. :)
  22. Thanks guys, unfortunately I got beaten submitting an answer. No cookies for anyone. :( ;)
  23. Well, it wouldn't be loads of code, but it would be a loop. You're only looking at about a half-dozen lines. Assuming you have a FolderBrowserDialog called fbd: If fbd.ShowDialog = DialogResult.OK Then Dim dirInfo As New DirectoryInfo(fbd.SelectedPath) Dim files() As FileInfo = dirInfo.GetFiles("*.jpg") Dim fInfo As FileInfo Dim newPath As String 'set newpath before this For Each fInfo In files File.Copy(fInfo.Name, newPath & "\\" & fInfo.Name) Next fInfo End If Air-coded so there might be a bug in there, but you should get the idea. :)
  24. You can easily populate a dataset from the text file. You simply read each line as you're doing, create a new datarow, populate the fields and add the datarow to the dataset. The book name, chapter, and verse would be indexed to all searching. There are tons of tutorials for working with datasets out there. Read a couple and you should be ready to go.
  25. Cookies are riding on the first solution to this: ∫(12x+8)(3x^2+4x) It's been about 20 years since I've done anything like this and I've pretty much forgotten all my advanced math. I'd be lucky to solve for x. :)
×
×
  • Create New...