Can anyone give me an 'overview' of how I can go about this? Googling my hands off the past week and can't find a definitive way of doing this.
All I've managed to do so far if this, which connects to the database fine.
No idea how to enter a record, I assumed you could just do an SQL statement and fill it from objects, but have no idea how to 'format' the argument (" " etc) or how to actually go about entering it once the argument has been formatted.
Edit, mod please fix title. Thanks
All I've managed to do so far if this, which connects to the database fine.
No idea how to enter a record, I assumed you could just do an SQL statement and fill it from objects, but have no idea how to 'format' the argument (" " etc) or how to actually go about entering it once the argument has been formatted.
Code:
Dim sqlConn As New SqlConnection("Data Source=hbcsql3;Initial Catalog=mailreader;User Id=usernamegoeshere;Password=pwgoeshere;")
Dim sqlAdap As New SqlDataAdapter("SELECT * FROM mail_info", sqlConn)
Dim sqlRS As String
Dim ContractStartPath As String
Dim ContractPath As String
Dim DatePath As String
Dim ID As String
Dim AllPath As String
Dim LengthPath As Integer
Dim DateLengthPath As Integer
Dim DatePathExe As String
AllPath = Application.ExecutablePath
LengthPath = AllPath.Length - 9
ContractStartPath = AllPath.Remove(0, 3)
ContractPath = ContractStartPath.Remove(6, LengthPath)
ID = DateTime.Now & DateTime.Now.Millisecond
DateLengthPath = AllPath.Length - 17
DatePathExe = AllPath.Remove(0, DateLengthPath)
DatePath = DatePathExe.Remove(8, 9)
[B]sqlRS = "INSERT into mail_info(name, mail_date, contract, read_date, id) VALUES (textbox2.Text, DatePath, ContractPath, DateTime.Now.Date, ID)"[/B]
Edit, mod please fix title. Thanks