Jump to content
Xtreme .Net Talk

mrdutchie

Avatar/Signature
  • Posts

    80
  • Joined

  • Last visited

Everything posted by mrdutchie

  1. I am looking everywhere on the internet about how/where to start when you want to do a newsreader. like Examples or what you need to do etc. Does anyone knows where can I find more information about this? Thanks
  2. This works great, except I can't figure out how to get rid of the whole programpath? Everything in the listbox shows as "C:\program files\Test Application\Forms\Reports\filename.xxx I just want the filename.xxx to show up
  3. The .hidden works great, but then whatever was in that column I can't get anymore.. ie. I have 4 columns ID Name PSW LEVEL I hide the ID column but when I click on the rows in my datagrid I can't get the value anymore from Column (0) since the .hidden option moved all the columns. So column(1) becomes Column(0) column(2) becomes Column(1) etc. Or is there a way to get those values?
  4. ALLRIGHT... :) Found it... it's just 1 line ds.Tables(mytable).Columns(0).ColumnMapping = MappingType.Hidden No need for all the other code..... Thanks guys... :cool: :cool:
  5. Woww.. After spending 6 hours on this last night I still don't understand and can't get it to work. I guess I need a little bit more help, to understand this part. The way I am filling my Datagrid, is that the wrong way? I have a Access Database with the table "User_sec" with 3 fields "ID" "User" "Psw" and "Level" and a Datagrid that's called "DGUSERS" I want to show all except "ID" that one needs to be hidden. I changed the code a little bit, so you can see the full thing mypath is the path to the database. Public Sub fillgrid() Dim MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyPath) Dim dg As DataGrid = dgusers Dim mytable As String = "user_security" Dim mydata As New DataGridTableStyle Dim ds As New DataSet Dim sqlstr As String = "SELECT * FROM " & mytable If Not MyConnection.State = ConnectionState.Open Then MyConnection.Open() Dim dstable As New OleDb.OleDbDataAdapter(sqlstr, MyConnection) dstable.Fill(ds, mytable) dg.DataSource = ds.DefaultViewManager dg.DataMember = mytable If Not MyConnection.State = ConnectionState.Closed Then MyConnection.Close() end Sub What do I need to change in the existing code, or do I need to rewrite it totally? I must say can I intergrate from what's writting above, or do I nee to start from scratch and forget about this code to fill a datagrid that I wrote.
  6. [PLAIN]Totally confused with datagrid. [solved][/PLAIN] Hello. I have the following: Public Sub populateGrid(ByVal MyTable As String, ByVal DG As DataGrid) Dim ds As New DataSet Dim sqlstr As String = "SELECT * FROM " & MyTable OpenDB() Dim dstable As New OleDb.OleDbDataAdapter(sqlstr, MyConnection) dstable.Fill(ds, MyTable) DG.DataSource = ds.DefaultViewManager DG.DataMember = MyTable CloseDB() End Sub and this when the form loads Dim mydata As New DataGridTableStyle mydata.MappingName = "id" populateGrid("user_security", dgusers) mydata.GridColumnStyles(0).Width = 0 dgusers.TableStyles.Add(mydata) now it's failing on the hidding part in the last 2 rows I can't figure out how to hide a column on a Datagrid populateGrid("user_security", dgusers) is filling the datagrid in the form (dgusers = the gridname) and had 4 columns 0 = ID 1 = Name 2 = Psw 3 = Level I want to hide Column 0 which I though was with this part mydata.GridColumnStyles(0).Width = 0 dgusers.TableStyles.Add(mydata) But that gives me a error. I've read several docs and forums but everytime it's something different. Could someone tell me what I'm doing wrong? Thank you so much...
  7. Thank you :) I knew it was something simple. Couldn't figure out the "Return True/False" part. Now I know how that works. Thanks again.
  8. Hello, this must be really simple, but I can't figure it out. I have this Procedure in another form. Public Sub checkfiles(ByVal continue As Boolean) continue = True fileExist = System.IO.File.Exists(databasepath + databasefile) If fileExist = False Then MsgBox("Error: Can't find the database file. Please check your setup and make sure your Database folder is correct.") continue = False End If fileExist = System.IO.File.Exists(configpath + configfile) If fileExist = False Then MsgBox("Error: Can't find the Configuration file. Please check your setup and make sure your Database folder is correct.") continue = False End If End Sub Now from my main program I can do this checkfiles(true) or checkfiles(false) But what I want is that it results a value. like this makesure=checkfiles() if makesure=False then end Did some searches but could not find anything, can someone help me out with this easy problem... Thanks so much
  9. Thank Devil... Guess I will be busy this weekend finding out how that part works.. :)
  10. Thanks... That might also explain why sometimes the icons are goovy. I will convert them to Bitmaps and use it like that. Thanks again :) :cool:
  11. Thanks, but I am not sure if we are on the same page;) If I add a ICO file to the Images collection library as number 5 then I can select that icon within my ie. my button as Imageindex 5 but how can I get within that ICO file that's in the Library under 5 the second or third icon, like image 5(1) or 5(2) just like a array Or do I need to save the icons all as seperate ICO files instead of 1 ICO file. Like the MS icons that have sometimes 6-8 pictures in it, each for it's own resolution.
  12. Ok, I have 3 icons in 1 ICO file, but how can I get each one seperate?. So far when I open the ICO file, It only shows the 1st one.
  13. My guess would be LINKING 1 database into the other one.
  14. Thank you very much... It solved my problem :) I knew it could be easier, but didn't know what.
  15. Hello, I am stuck since last week with the following problem. I have several reports created and I can do the following Dim CrReport1 As New crystalReport1 Dim CrReport2 As New crystalReport2 Dim CrReport3 As New crystalReport3 But what I like to do it browse for your report and put that value in a Textbox and then do Dim CrReport as new 'your selected report from the Textbox So I won't need to write a whole procedure for each report with those 3 Dim Statements. Is this possible at all?
  16. This is how you do this sPath = "c:" If Dir(sPath & "\Temp.mdb") > "" Then Kill(sPath & "\Temp.mdb") CompactDatabase(workfile, JetEngineTypes.JetCompatible, True) ', "c:\Temp.mdb")
  17. YES!!! Panel40.Controls.Clear() was the one I was looking for... Thanks so much.
  18. That's correct :-) And I can't do a form.dispose within that panel. so I need something to clear the panel, cause the form name etc. it not recognized elsewhere in my code. And this is how you create a form within a panel on another form.. I have a mainform with 3 panels. ala Outlook Style. panel 40 is the right panel for me, and thats where everything is happening. I have a button on the left site, and this is what's underneath that button. Dim addressbook As Form addressbook = New Frmaddressbook addressbook.TopLevel = False addressbook.Dock = DockStyle.Fill addressbook.Parent = Panel40 addressbook.Show() Good luck
  19. Must be very simple but I can't figure it out. I have a panel with a form loaded. I want to get rid of the form within that panel, when I push on a button outside that panel. Thought I use a Clear function, like panel1.clear but that ain't there... Is there a easy way to clear a panel?
  20. When I create a Access DB file how/where do I set the command so that I can change 1 field to be "Not Required" ? ADOXtable1.Name = "Addressbook" ADOXtable1.Columns.Append("Prefix", ADOX.DataTypeEnum.adVarWChar, 50) ADOXtable1.Columns.Append("Firstname", ADOX.DataTypeEnum.adVarWChar, 50) ADOXtable1.Columns.Append("Middlename", ADOX.DataTypeEnum.adVarWChar, 50) ADOXtable1.Columns.Append("Lastname", ADOX.DataTypeEnum.adVarWChar, 50) ADOXtable1.Columns.Append("Address1", ADOX.DataTypeEnum.adVarWChar, 50) ADOXtable1.Columns.Append("Address2", ADOXtable1.Columns.Append("ID", ADOX.DataTypeEnum.adDouble, 10) ADOXcatalog.Tables.Append(ADOXtable1) With this all Fields are Required when I look in Access, how to change it to NOT Required? Thanks
  21. Thought I would share this with you, since you all helped me out. *** ADD RECORDS *** value1 = "hello" value2 = "there" Dim mycon As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/database.mdb") Dim mycmd As OleDbCommand = New OleDbCommand mycmd.Connection = mycon mycmd.CommandText = "INSERT Into email (name,email) Values ('" & Value1 & "','" & Value2 & "')" mycon.Open() mycmd.ExecuteNonQuery() mycon.Close() *** DELETE RECORDS *** Dim mycon As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/database.mdb") Dim mycmd As OleDbCommand = New OleDbCommand mycmd.Connection = mycon mycmd.CommandText = "DELETE FROM email WHERE name='hello'" mycon.Open() mycmd.ExecuteNonQuery() mycon.Close() *** UPDATE/EDIT RECORDS *** Dim mycon As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/database.mdb") Dim mycmd As OleDbCommand = New OleDbCommand mycmd.Connection = mycon mycmd.CommandText = "UPDATE email SET email='no e-mail' WHERE name='hello'" mycon.Open() mycmd.ExecuteNonQuery() mycon.Close()
  22. please forget my last comment. It's working now... forgot that "perry@hotmail.com" was not in the database. duh.... Thanks so much for helping me out.
  23. now I am really puzzled. getting no error this time, but it does not update either Dim mycn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/donation.mdb") Dim mycmd As OleDbCommand = New OleDbCommand("UPDATE email SET name='hello' WHERE name='perry' AND email='perry@hotmail.com'", mycn) mycn.Open() mycmd.ExecuteNonQuery() mycn.Close()
×
×
  • Create New...