Комментарии:
i will love u my guyyyyyyyyyy
ОтветитьThanks
Ответитьhi.. i'm catching up your videos, .. but in my case, i want to insert data that having primary key data with formated data (ex. A001). how can i get the latest number? please help me.. thanks.. btw thanks alot for the video
ОтветитьHi sir , I apply every steps shown in the Tutorial but i am using local -based SQL database , and my problem is data dose not be ,saved in table after inserting , but it shown in application , then after i restart my application the data also disappear what is the problem ?
ОтветитьA good instructor indeed. Thanks very much pro VB tutor.
ОтветитьDo you know how to solve Duplicating/repeating Line of records in details section .. Using multiple sql query... (inner join 4 tables)
ОтветитьHi I have a question
So I have used you lecture as a template and added 9 items to the database the private sub on "sqlcontrol" is otherwise exactly as your but in the form that I have created to enter the details even though I included the line "Dim SQL As New SQLControl" I get the message that AddMember is not a member of SQlControl my version of the two pieces of text are below - Have you any ideas as to why its underlined and not recognised please ?
Public Sub AddMember(Title As String, Firstname As String, Surname As String, HouseNo As String, PostCode As String, MobileNo As String, Email As String, Regno As String, Newsletter As Integ)
Try
Dim strInsert As String = "INSERT INTO Customer(Title , Firstname , Surname , HouseNo , PostCode , MobileNo , Email , Regno , Newsletter) " &
"VALUES (" &
"'" & Title & "'," &
"'" & Firstname & "'," &
"'" & Surname & "'," &
"'" & HouseNo & "'," &
"'" & PostCode & "'," &
"'" & MobileNo & "'," &
"'" & Email & "'," &
"'" & Regno & "'," &
"'" & Newsletter & "' "
MsgBox(strInsert)
SQLCon.Open()
SQLCmd = New SQLCommand(strInsert, SQLCon)
SQLCmd.ExecuteNonQuery()
SQLCon.close()
Catch ex As Exception
MsgBox(ex.message)
End Try
End Sub
End Class
Public Class AddUser
Dim SQL As New SQLControl
Private Sub btnSaveNewUser_Click(sender As Object, e As EventArgs) Handles btnSaveNewUser.Click
'Confirm that they are not already registered
Sql.RunQuery("Select * From Customer Where customer.firstname = '" & txtFname.Text & "' " & "Customer.Surname = '" & txtSurname.Text & "' ")
If Sql.SQLDataset.Tables(0).Rows.Count > 0 Then
MsgBox("User is Already Registered!")
Exit Sub
Else
CreateUser()
End If
End Sub
Public Sub CreateUser()
If Len(txtFname.Text) >= 3 And Len(txtSurname.Text) >= 4 And Len(txtSurname.Text) >= 6 And Len(txtHouseNo.Text) > 0 And Len(txtPostCode.Text) > 7 And Len(txtMobileNo.Text) > 7 And Len(txtEmail.Text) > 7 And Len(txtRegNo.Text) > 2 Then
'Newletter Checkbox
Dim Newsletter As Integer
If rbNewsletter.Checked = True Then Newsletter = 1 Else Newsletter = 0
'Add new user to database
SQL.AddMember(txtTitle.Text, txtFname.Text, txtSurname.Text, txtHouseNo.Text, txtPostCode.Text, txtMobileNo.Text, txtEmail.Text, txtRegNo.Text, rbNewsletter.Text)
Else
MsgBox("Please make sure you have filled in ALL Fields Correctly!")
Exit Sub
End If
End Sub
End Class
Also I have saved the file and in the build pull down tried rebuilding it ?
Useful Tutorial. Thanks Man!!.
ОтветитьHi.
I have a question.
I have three tables in my database. In your tabpage2, you will be able to create new record right? In your tutorial, you'll only be able to create a new record in the first table only. How am I be able to create new record for the second or third or other table? Or maybe is it okay if there's a combo box in tha tabpage2 where you can choose on what table you will add your new record? Please answer. Thanks a lot.
I'm in need of inserting records into TABLE2 which has a relationship established to TABLE1. In a simplistic example:
TABLE1
StudentID int _PK
Name VarChar(20), null
TABLE2
ClassID int _PK
StudentID int _FK
Class Name VarChar(15), null
Any assistance you could provide would be greatly appreciated. I have looked around buy YT doesn't have any related videos to what I'm attempting to do. Thanks in advance.
hi sir, i have a question...
i have a 4 column named item, description, model/Serial and quantity.
if i want to insert into the said 4 column it will check if the items exist and if it does,
it will just add to the quantity.
here's my code:
SQL.AddParams("@item", txtAddItem.Text)
SQL.AddParams("@desc",txtdescription.Text)
SQL.AddParams("@model", txtModSerial.Text)
SQL.AddParams("@Qty", txtQuantity.Text)
SQL.ExecQuery("SELECT * FROM Item_Main WHERE Itm_Code=@item")
If SQL.SQLDs.Tables(0).Rows.Count > 0 Then
SQL.ExecQuery("UPDATE Item_Main " & _
"SET Qty = Qty + @qty" & _
"WHERE Itm_Description=@desc and Itm_ModSerial=@model ")
it doesn't give me an error though, but it doesn't add my quantity column.
hope you can help me with this...
thank you soo much..
Hello There !
I have a question,
How to Insert data into two table with same command ? Help me plsss :) THNX !
ive been trying to save a label but it wont work it resets every time i push the load button?? this is my script:
load button:
lbl_cash.Text = My.Settings.Savecash
lbl_cps.Text = My.Settings.Savecps
Save button:
My.Settings.Savecash = lbl_cash.Text
My.Settings.Savecps = lbl_cps.Text
Really good tutorials, I have downloaded the source files but I have noticed that there is no database inside the files. could please provide me a link where I can download the files with the database. Thank you. I am having problem with sql management 2014/ SQL 2014 as it has many changes and wont open previous Microsoft sql databases, it ask for update and I do that and then something else is wrong with that database , not nice on part of Microsoft, spent few hours trying resolve it. That I would appreciate a database with the project files.
ОтветитьWHERE IS THE LINK? YOIU SAID SO.
ОтветитьHI
HOPE U HAVE GOOD DAY.
ITS AN AWSUM TUTORIAL FOR BIGNNERS LIKE ME.ITS REALLY HELP ME ALOT.
BUT I HAVE AN QUESTION MAY BE U CAN HELP ME ON IT.
HOW CAN U BLOCK THE EMPTY ADD FROM TEXTBOXES ?
THANKS ALOT AGAIN
BEST OF LUCK
This is the best tutorial i've ever watched. Seriously! Thanks a lot!
ОтветитьHow do I get the source code to the series of videos? They are extremely instructive, but the complete source code printed out to study would be even more helpful.
thanks,
Please share the link to the source code.
Ответитьhello, great work thank you so much
everything is ok with your code but i have a textbox to enter birthdate how can i insert the date to the sql server
am getting an error incorrect syntax near 'MM-dd-yyyy'
any help?????
YES, I got this to work too!!
ОтветитьVB Toolbox, great tutorials indeed, as a raw beginner I am learning a lot.
Where can I download the VB code you type in within your videos?
Your tutorials are the best I have seen. Insert Records into SQL DB Part 3 is exactly what I needed for my project. I am building an inventory database to keep track of all the laptops, servers and other equipment we have assigned to locations all over the US. The last feature I am trying to add is the ability to copy the data fields on the form and create a new record in the database. The idea is a laptop is re-issued to a new user, we want to keep history and make a new record for the new user. For data entry ease, would be nice to copy the fields that remain the same and then the data entry person can update just the changed fields.
I followed your tutorial very carefully and have your code working properly on a test form within my project. However when I apply the same code to my working form, I get an "error converting data type varchar to numeric".
I even tried copying just a few fields, and then just the first field and still get the error. My data types are varchar, numeric and datetime. Since all fields are like: ByVal AssetTag As String, I can't figure out why/ where the problem is.
My code runs past the MsgBox(srtInsert) and displays the column names and the values, but I don't see all of the values in the message. The values looks like this: ('3337','','LPT587','DPV9G11','','','', and so on. (Looks like some of the field values are missing.) Then the error message is displayed.
Is the problem that is is not reading the numeric values properly that should be displayed in the messagebox? The values that appear to be missing are the selected index values for combo boxes. I tested for this in my test form and had no problem so I am kind of stuck.
Any ideas would be very much appreciated.
Hello. I have a question regarding on how to add data into sql server and view it into the datagrid as well. Hope you'll find time reading my comment here. :) Thanks
Ответитьdo you have an entity framework tutorial ?
ОтветитьHey I wanna make a database with two columns "Code" and "Quantity". So if column Code contains a specific value and a quantity when Im gonna insert again the same code with different quantity I want the new quantity to add it to the last one. How can I do that? O_o
ОтветитьHi, Thanks for all! your tutorials are awesome.
All are very helpful tutorial, but there is some questions that i need your help for,
How do I create my "INSERT INTO" to allow both valid dates or NULL values to be used when inserting into an Access database. I have spent hours on this, including saving the text fields to variants, and all sorts of other things. it's an emergency case I will appreciate very your help Thank you :)
This tutorial has been very helpful to my university project. I'm highly grateful.
ОтветитьI get error index out of range on statement below.What myt be wrong?
If Sql.SqlDataset.Tables(0).Rows.Count <> 0 Then
Thanks a lot for those helpful tutorials,and you explain in a very nice or great and calm style,do u know that i have been googling the net for a year to look for classes tutorial!!,i am waiting to learn more from your fantastic videos.i need that very urgent and will be appreciated if you upload many and many of those great videos.thanks again for your help !!!
ОтветитьYou have no idea how much this is helping me for work right now, amazing
Thank you