I am having an app in visual c# ,, i need to retrieve the table values of coloumn name title corresponding to a certain user id in combobox on the same form . can anyone help me doing this ?
Amanpreet_1
0
Light Poster
Recommended Answers
Jump to PostHi,
If I understand your question the combo box will have the id in it (or maybe the user's name only) so you will get the selected item of the combo box and then use that value in the sql query. You can't use parameters for column names (unless I'm …
Jump to PostYou can use as many as you like to get the job done.
Jump to PostPlease show your code where you are getting the problem
Jump to PostTo what i understand from your requirements following code may be helpful
private void richtxtbox(object sender, EventArgs e) { //declare connection string string stcon = "your connection string"; //Storing the selected Combobox entry string combosl = comboBox1.SelectedItem.ToString(); //Your sql query string sql="SELECT id FROM Video WHERE video_id="+combosl; …
Jump to Poststring sql="SELECT u_id FROM views WHERE video_id="+combosl;
This is all you have to change.
P.S:Please google your problems first and if you don't find any ans then ask
All 30 Replies
hericles
289
Master Poster
Featured Poster
Amanpreet_1
0
Light Poster
hericles
289
Master Poster
Featured Poster
Amanpreet_1
0
Light Poster
johnrosswrock
0
Light Poster
Amanpreet_1
0
Light Poster
johnrosswrock
0
Light Poster
Amanpreet_1
0
Light Poster
johnrosswrock
0
Light Poster
Amanpreet_1
0
Light Poster
johnrosswrock
0
Light Poster
Fenrir()
52
Newbie Poster
Amanpreet_1
0
Light Poster
Amanpreet_1
0
Light Poster
Fenrir()
52
Newbie Poster
Amanpreet_1
0
Light Poster
Fenrir()
52
Newbie Poster
Amanpreet_1
0
Light Poster
johnrosswrock
0
Light Poster
Amanpreet_1
0
Light Poster
Fenrir()
52
Newbie Poster
johnrosswrock
0
Light Poster
Amanpreet_1
0
Light Poster
Amanpreet_1
0
Light Poster
Fenrir()
52
Newbie Poster
Amanpreet_1
0
Light Poster
Fenrir()
52
Newbie Poster
Amanpreet_1
0
Light Poster
Amanpreet_1
0
Light 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.