Hi,
i want to create a query which select three columns from a table on certain condition now i have got certain with three columns and i can bind this data to a datagridview but before this i want to add a column to dgv say col_new and fill its cell with a variable value
here's my querySELECT PID, Name, FName FROM Tbl_Products WHERE PID = '" + PID.ToString()
iwant to do somthing like thisSELECT '"+ Col_New.text +"' PID, Name, FName FROM Tbl_Products WHERE PID = '" + PID.ToString()
and when ill bind my data to dgv then i should get PID Name FName from table and Col_New from variable
de Source
0
Light Poster
Recommended Answers
Jump to PostSo what issue are you having? Not sure exactly what you mean, but In any case, I would think you are missing a comma (and apostrophe at the end) in your second SQL example..
sqlString = "SELECT '"+ Col_New.text +"', PID, Name, FName FROM Tbl_Products WHERE PID = '" + …
All 3 Replies
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
de Source
0
Light Poster
M.Waqas Aslam
67
Posting Pro in Training
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.