Hi,
My application is in VS2008 coded in Vb.net.
I have a datagridView which is getting populated from the Database.I has RegNo,RollNo,Name etc fields.The data in the Name column of database is coming from 3 columns of a certain table from database.
This is how im concatinating it and displaying in datagrid.
SELECT StudAllocDtls.RegNo,StudAllocDtls.RollNo,AdmittedStudents.SurName + ' ' + AdmittedStudents.FirstName + ' ' + AdmittedStudents.LastName
.
My issue is i want to save this data in some other table which also has Surname,FirstName,LastName columns in the database.
Im not able to split the column data present in datagridview cell into three fields.
For Example:Name column in datagridview is having Name : Sachin Ramesh Tendulkar.
I want to divide this string into three like : Sachin for Surname,Ramesh for First Name,Tendulkar for LastName.
This is my query:
"INSERT INTO SmsSetting(Regno,RollNo,SurName + ' ' + FirstName + ' ' + LastName,MobileNo, FathMobile,MothMobile)VALUES('" & DGVStudRecord.Item(0, i).Value.ToString & "','" & DGVStudRecord.Item(1, i).Value.ToString & "','" & DGVStudRecord.Item(2, i).Value.ToString & "','" & DGVStudRecord.Item(3, i).Value.ToString & "','" & DGVStudRecord.Item(4, i).Value.ToString & "','" & DGVStudRecord.Item(5, i) & "'
Please correct me where can i fetch