Fix the problem self with this code
hendrikbez
Posts
-
I want to show the first lettter of token to be upercase in my code, but it then show the page name and not the token name -
I want to show the first lettter of token to be upercase in my code, but it then show the page name and not the token nameI have the following code that is sist make the firs leter of a token uppercase, do not know if this is the correct way to do it.
I only run thos on my local machine
The value of slug is the token name on coinmarketcup
At the moment when I open the page it show me the name of the token that I have click on, but they are all lowercase, so I want it to show the first letter in uppercase.
If i using the code that i have giving it shows CoinDetails (it is my page name)
thiss is the code that is not working
Try to use this with this code
-
search for date inf vb.net from excel to datagridYes I do not have any training in vb.net. I am trying to lean it on my own, as the courses here in south Africa is very expensive. Where must the date be not string/text, I don’t understand where I should change it.
-
search for date inf vb.net from excel to datagridI really need help with this. 1. I have a excel file with columns with text and some with only the date in it (07/16/2013). This date can be in more than one row. 2. I then have a form where I can display all the info in the form (Eg like if I choose server, it will show me that server info on the form with all the other details that goes with it. I get the info form my excel file. 3. I then have a button to search for info eg Server names, it then make a data grid view and show my all the servers that start with eg. Prasa. 4. Now my problem is I cannot get it to search for a date. I need help with this. Here is my main code and my button date search code. Is the a sample of this or can someone help me with this.
Imports System.Data.OleDb
Public Class Tapes_info
Private dtGlobal As New DataTablePrivate Sub Tapes\_info\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dtGlobal.Clear() Using cn As New OleDb.OleDbConnection Dim Builder As New OleDbConnectionStringBuilder With {.DataSource = IO.Path.Combine(Application.StartupPath, "Backuptapes.xls"), .Provider = "Microsoft.ACE.OLEDB.12.0"} Builder.Add("Extended Properties", "Excel 12.0; IMEX=1;HDR=No;") cn.ConnectionString = Builder.ConnectionString cn.Open() Using cmd As OleDbCommand = New OleDbCommand With {.Connection = cn} cmd.CommandText = "SELECT TOP 5130 F1 As Tapes, F2 As Containere, F3 as ContainerRef, F4 as DateOut FROM \[Tapese$\]" Dim dr As System.Data.IDataReader = cmd.ExecuteReader dtGlobal.Load(dr) LstTape.DisplayMember = "Tapes" LstTape.DataSource = dtGlobal txtContainer.DataBindings.Add("Text", dtGlobal, "Containere") txtContainerRef.DataBindings.Add("Text", dtGlobal, "ContainerRef") txtDateOut.DataBindings.Add("Text", dtGlobal, "Dateout") End Using End Using End Sub
Private Sub BtnSearchDateOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearchDateOut.Click
For i As Integer = 0 To dtGlobal.Rows.Count - 1 If IsDBNull(dtGlobal.Rows(i)("Dateout")) Then dtGlobal.Rows(i)("Dateout") = "" End If Next Dim query = From item In dtGlobal.AsEnumerable() Where item.Field(Of String)("Dateout").StartsWith(txtSearchDateOut.Text) Select it
-
Search and delete filesThank you I am using this code to get files, but I can not get it to search for all files on C: drive. How can I get it to show all files Like *.pdf of the dirve in the list box
Imports System.IO
Imports System
Imports System.Drawing
Imports System.Windows.FormsPublic Class SearchAvi
Private Sub BtnGetAviFiles\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGetAviFiles.Click Dim dir1 As New IO.DirectoryInfo("c:") Dim dir2 As IO.FileInfo() = dir1.GetFiles() Dim files1 As IO.FileInfo For Each files1 In dir2 FrmListBox.Items.Add(files1) Next End Sub
-
Search and delete filesI did do a search but cannot find any sample. I am looking for a sample like this. 1. Search c: for say *.pdf files. 2. Show files in a grid with name of file, size, path. 3. Then I can delete all or just choose the files I want to delete.
-
Help with updateWith my Breakpoint. 1. Click on button "Edit info" 2. Say I must choose a leidraad to edit 3. Choose number 4 from listbox On this code
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim SqlStr As String SqlStr = "Select \* from tblokkies where leidraad = """ & ListBox1.Items(ListBox1.SelectedIndex) & """" FillTextBox(SqlStr) End Sub
On F8 SqlStr = "Select * from tblokkies where leidraad = """ & ListBox1.Items(ListBox1.SelectedIndex) & """" SqlStr ========"Sqltr "Select *from tblokkies where leidraad = "'n uitroep"" ListBox1.SelectedIndex)=========="Listbox1.Seletectedindex 3 FillTextBox(SqlStr) ========"Filltextbox Nothing It then fills my textboxes with this info 4. info in this from row in my table ====Luidraad ='n uitroep" A1=gits, A2=aag,A3=SA (My textboxes luidraad,A1,A2,A3,) Want to put info now in A4=test" (textbox A4) 4. Click on Save button. On this code after F8
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
If SaveOrEdit = "Save" Then Dim add As DialogResult add = Cls\_MessageBbox.Show("Is jy Seker jy will Leidraad" & vbCrLf & vbCrLf & TxtLuidraad.Text & vbCrLf & vbCrLf & "Byvoeg", "Byvoeg.", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If add = Windows.Forms.DialogResult.Yes Then AddNew() Else ListBox1.Text = "Geen leidraad is Bygevoeg nie" End If ElseIf SaveOrEdit = "Edit" Then Edit() Else StatusLabel.Text = " Geen Leidraad is bygevoeg" End If End Sub
If SaveOrEdit = "Save" Then =====Saveoredit "" Then jumbs to ElseIf SaveOrEdit = "Edit" Then =======Saveordeit "" StatusLabel.Text = " Geen Leidraad is bygevoeg"=========Statuslabel.text "Leidradd :'n Uiroep: geselkteer" After F8 StatusLabel.Text = " Geen Leidraad is bygevoeg"=========Statuslabel.text "Geen Leidraad is bygevoeg" This is where it stops.
-
Help with updateMy string1 and string2 will always have info in, I only want to add string3 today, and later string4 and so on, so when I click on my listbox it chooses the info and put it in my textboxers, then I add a new word to string3, then it must update, but it don't
-
Help with updateThanks, now I am getting a answer back, that it did not save it to database, before, I did not get anyting back Edit Ps sometimes it says that is have saved the info, but there it did not sdaved it in the data base
-
Help with updateeven if I use this
MyOledbCommand.CommandText = "UPDATE Tblokkies SET leidraad = @string1, A1 = @string2, A2 = @string3, A3 = @string4,A4 = @string5, A5 = @string6, A6 = @string7, A7 = @string8, A8 = @string9, A9 = @string10, A10 = @string11, A11 = @string12, A12 = @string13"
I can not get it to save to the database
-
Help with updateI am not getting my program to update my access 2003 database. What the hek am I doing wrong. This is the only problem that I still have in my program Here is my code (function)
Public Function Edit() As String
TryDim OleDbConn As OleDbConnection = New OleDbConnection(ConnString) OleDbConn.Open() Dim MyOledbCommand As OleDbCommand = New OleDbCommand() Dim String1, String2, String3, String4, String5, string6, string7, string8, string9, string10, string11, string12, string13 As String String1 = TxtLuidraad.Text String2 = txtA1.Text() String3 = txtA2.Text() String4 = txtA3.Text() String5 = txtA4.Text() string6 = txtA5.Text() string7 = txtA6.Text() string8 = txtA7.Text() string9 = txtA8.Text() string10 = txtA9.Text() string11 = txtA10.Text() string12 = txtA11.Text() string13 = txtA12.Text() MyOledbCommand.CommandText = "UPDATE Tblokkies SET WHERE leidraad = ?, A1 = ?, A2 = ?, A3 = ?,A4 = ?, A5 = ?, A6 = ?, A7 = ?, A8 = ?, A9 = ?, A10 = ?, A11 = ?, A12 = ?" MyOledbCommand.Parameters.AddWithValue("@string1", Me.TxtLuidraad.Text) MyOledbCommand.Parameters.AddWithValue("@string2", Me.txtA1.Text) MyOledbCommand.Parameters.AddWithValue("@string3", Me.txtA2.Text) MyOledbCommand.Parameters.AddWithValue("@string4", Me.txtA3.Text) MyOledbCommand.Parameters.AddWithValue("@string5", Me.txtA4.Text) MyOledbCommand.Parameters.AddWithValue("@string6", Me.txtA5.Text) MyOledbCommand.Parameters.AddWithValue("@string7", Me.txtA6.Text) MyOledbCommand.Parameters.AddWithValue("@string8", Me.txtA7.Text) MyOledbCommand.Parameters.AddWithValue("@string9", Me.txtA8.Text) MyOledbCommand.Parameters.AddWithValue("@string10", Me.txtA9.Text) MyOledbCommand.Parameters.AddWithValue("@string11", Me.txtA10.Text) MyOledbCommand.Parameters.AddWithValue("@string12", Me.txtA11.Text) MyOledbCommand.Parameters.AddWithValue("@string13", Me.txtA12.Text) MyOledbCommand.Connection = OleDbConn MyOledbCommand.ExecuteNonQuery() OleDbConn.Close() DisableTextboxes() NeroBar1.Value = 0 FillDataGrid("Select \* from Tblokkies")
-
Can only delete numbers in access databaseI am usinf this to fill my listbox1
Do While MyDataReader.Read
ListBox1.Items.Add(MyDataReader("Leidraad")) Dim MyItem = ListView1.Items.Add(MyDataReader("Leidraad".ToString)) With MyItem .SubItems.Add(MyDataReader("A1").ToString) .SubItems.Add(MyDataReader("A2").ToString) .SubItems.Add(MyDataReader("A3").ToString) .SubItems.Add(MyDataReader("A4").ToString) .SubItems.Add(MyDataReader("A5").ToString) .SubItems.Add(MyDataReader("A6").ToString) .SubItems.Add(MyDataReader("A7").ToString) .SubItems.Add(MyDataReader("A8").ToString) .SubItems.Add(MyDataReader("A9").ToString) .SubItems.Add(MyDataReader("A10").ToString) .SubItems.Add(MyDataReader("A11").ToString) .SubItems.Add(MyDataReader("A12").ToString) End With Loop
and these also
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim SqlStr As String SqlStr = "Select \* FROM tblokkies WHERE leidraad='" & ListBox1.Items(ListBox1.SelectedIndex).ToString() & "'" 'SqlStr = "Select \* from tblokkies where leidraad = """ & ListBox1.Items(ListBox1.SelectedIndex) & """" FillTextBox(SqlStr) End Sub
-
Can only delete numbers in access databaseI can only now delete numbers from acces 2003 and not text. I have tryd this diffrent code, and all of them only delete numbers Eg "888". It cant delete "myname" or "1 myname" only if everthing is numbers
MyOledbCommand.CommandText = "DELETE * FROM tblokkies WHERE leidraad='" & ListBox1.Items(ListBox1.SelectedIndex) & "'"
MyOledbCommand.CommandText = "DELETE * FROM tblokkies WHERE leidraad = """ & ListBox1.Items(ListBox1.SelectedIndex) & """"
MyOledbCommand.CommandText = "DELETE * FROM tblokkies WHERE leidraad='" & ListBox1.Items(ListBox1.SelectedIndex).ToString() & "'"
My colums is only set to text and leidraad is the primary key. I don't know if it has to do with my insert to the table, here is the code I am using.
MyOledbCommand.CommandText = "Insert Into Tblokkies " & "(leidraad,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12) " _
& "Values (" _
& "'" & String1 & "', " _
& "'" & String2 & "', " _
& "'" & String3 & "', " _
& "'" & String4 & "', " _
& "'" & String5 & "', " _
& "'" & string6 & "', " _
& "'" & string7 & "', " _
& "'" & string8 & "', " _
& "'" & string9 & "', " _
& "'" & string10 & "', " _
& "'" & string11 & "', " _
& "'" & string12 & "', " _
& "'" & string13 & "')" -
Cannot update or delete access databasenow what is the best why do wright this code, I am new and want to get this right.
-
Cannot update or delete access databaseI am new to databse, I don't know how to set the value in the code yet. I did try this, but it is not working If inc <> -1 Then ds.Tables("Blokkies").Rows(inc).Item(1) = TxtLuidraad.Text ds.Tables("Blokkies").Rows(inc).Item(2) = txtA1.Text ds.Tables("Blokkies").Rows(inc).Item(3) = txtA2.Text ds.Tables("Blokkies").Rows(inc).Item(4) = txtA3.Text ds.Tables("Blokkies").Rows(inc).Item(5) = txtA4.Text ds.Tables("Blokkies").Rows(inc).Item(6) = txtA5.Text ds.Tables("Blokkies").Rows(inc).Item(7) = txtA6.Text ds.Tables("Blokkies").Rows(inc).Item(8) = txtA7.Text ds.Tables("Blokkies").Rows(inc).Item(9) = txtA8.Text ds.Tables("Blokkies").Rows(inc).Item(10) = txtA9.Text ds.Tables("Blokkies").Rows(inc).Item(11) = txtA10.Text ds.Tables("Blokkies").Rows(inc).Item(12) = txtA11.Text ds.Tables("Blokkies").Rows(inc).Item(13) = txtA12.Text da.Update(ds, "Blokkies") MsgBox("Register verander") End If
modified on Thursday, March 19, 2009 2:27 AM
-
Cannot update or delete access databasesorry, how do you check the value and that the daataset is not empty
-
Cannot update or delete access databaseI am trying to update and delete ,but get this error code now, it did work before. error code == "There is no row at position -1" My update code
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Dim cb As New OleDb.OleDbCommandBuilder(da) ds.Tables("Blokkies").Rows(inc).Item(1) = TxtLuidraad.Text ds.Tables("Blokkies").Rows(inc).Item(2) = txtA1.Text ds.Tables("Blokkies").Rows(inc).Item(3) = txtA2.Text ds.Tables("Blokkies").Rows(inc).Item(4) = txtA3.Text ds.Tables("Blokkies").Rows(inc).Item(5) = txtA4.Text ds.Tables("Blokkies").Rows(inc).Item(6) = txtA5.Text ds.Tables("Blokkies").Rows(inc).Item(7) = txtA6.Text ds.Tables("Blokkies").Rows(inc).Item(8) = txtA7.Text ds.Tables("Blokkies").Rows(inc).Item(9) = txtA8.Text ds.Tables("Blokkies").Rows(inc).Item(10) = txtA9.Text ds.Tables("Blokkies").Rows(inc).Item(11) = txtA10.Text ds.Tables("Blokkies").Rows(inc).Item(12) = txtA10.Text ds.Tables("Blokkies").Rows(inc).Item(13) = txtA10.Text da.Update(ds, "Blokkies") MsgBox("Register verander") End Sub
I did try to use this, but still get same error
If Not IsDBNull(ds.Tables("Blokkies").Rows(inc).Item("luidraad")) Then
ds.Tables("Blokkies").Rows(inc).Item(1) = TxtLuidraad.Text
End IfMy delete code
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
If MessageBox.Show("Is jy seker jy wil die register verwyder?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.No Then MsgBox("Register is nie verwyder nie") Exit Sub End If Dim cb As New OleDb.OleDbCommandBuilder(da) ds.Tables("Blokkies").Rows(inc).Delete() maxrows = maxrows - 1 inc = 0 NavigateRecords() da.Update(ds, "Blokkies") End Sub
-
Listbox to textboxescelso_cabaleiro Thank you it is working. I don't know how to do it, can you help me with this please I want to use txtluidraad.text to do a search, and then when I type in the word, listbox must go to that one, must I add a new listbox or will the one that I have work. I don 't know how to use a search at all. Hope you can help me.
-
Listbox to textboxesSorry my engilsh is not so good, what do you mean by illegble and deliberate. Is there onther way do this this codeing. Luidraad type = text (150) No quotes Can not see waht line is blowing up. Did step true here is what I get when I press F8. 1. Click on 4th entry in listbox1 (Hendrik) 2. Dim Sqlstr as string (Sqlstr Nothing) 3. After F8 = Dim Sqlstr as string (Sqlstr "Select *from tblokkies where luidraad=Hendrik") 4. listbox1.items(listbox1.selectedindex) (Listbox1.items {System.Windows.forms.listbox.objectcollection) 5 After F8 = listbox1.items(listbox1.selectedindex) (Listbox1.selectedindex 4) 6. Filltextbox(Sqlstr) (Filltextbox Nothing) 7. Dim Oledbconn as oledbconnection = new oledbconnection(Connstring) (OleDbConn {system.data.oleDbConnection} (ConnectionString "Provider=microsoft.jet.oledb.4.0;data source=c:\blokkies\blokkies.mdb" (ConnectionTimeout 15 (Conteiner nothing (Database "" (DataSource "c:\blokkies\blokkies.mdb" (Provider "Microsoft.jet.oledb.4.0" (Serverversion {"invalid operation. The connection is closed"} (Site Nothing (State Closed {0} 8. dim myoledbcommand nothing dbconn 9. after F8 (Myoledbcommand {system.data.oledb.oledbcommand} (commandtext "" (Commandtimeout 30 (commandtype text {1} (connection nothing (container nothing (designtimevisible true (parameters {system.data.oledb.oleparametercollection} (Site nothing (transaction nothing (updatedrowsource both {3} 10. myoledbcommand.connection = (oledbconn) (OleDbConn {system.data.oleDbConnection} (ConnectionString "Provider=microsoft.jet.oledb.4.0;data source=c:\blokkies\blokkies.mdb" (ConnectionTimeout 15 (Conteiner nothing (Database "" (DataSource "c:\blokkies\blokkies.mdb" (Provider "Microsoft.jet.oledb.4.0" (Serverversion "04.00.0000" (Site Nothing (State open {1} 11. myoledbcommand.commandtext =sqlstring = myoledbcommand.commandtext "" 12. After F8 =sqlstring = "select*from tblokkies where luidraad=Hendrik"
-
Listbox to textboxesI am trying to when I click on a name in linkbox1 to show all the data in access database table in my texboxes. But it gives me this error "No value given for one or more required parameters" Here are my Code. Don't know why it is not working Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged Dim SqlStr As String SqlStr = "Select * from tblokkies where luidraad = " & ListBox1.Items(ListBox1.SelectedIndex) FillTextBox(SqlStr) End Sub Public Function FillTextBox(ByVal Sqlstring As String) Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString) OleDbConn.Open() Dim MyDataReader As OleDbDataReader Dim MyOleDbCommand As OleDbCommand = New OleDbCommand() MyOleDbCommand.Connection = (OleDbConn) MyOleDbCommand.CommandText = Sqlstring MyDataReader = MyOleDbCommand.ExecuteReader Try Do While MyDataReader.Read TxtLuidraad.Text = (MyDataReader.Item(1)) txtA1.Text = (MyDataReader.Item(2)) txtA2.Text = (MyDataReader.Item(3)) txtA3.Text = (MyDataReader.Item(4)) txtA4.Text = (MyDataReader.Item(5)) txtA5.Text = (MyDataReader.Item(6)) txtA6.Text = (MyDataReader.Item(7)) txtA7.Text = (MyDataReader.Item(8)) txtA8.Text = (MyDataReader.Item(9)) txtA9.Text = (MyDataReader.Item(10)) txtA10.Text = (MyDataReader.Item(11)) Loop Catch err As System.Exception MyDataReader.Close() OleDbConn.Close() OleDbConn.Dispose() End Try End Function