Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a DataGrid, bound to database table customer.Here is my database query
sqlitecon.Open();
string Query = "Select Card_Number,Clients_Title,Address_Current,Phone_Number,Mobile_Number from Customer_New "; SQLiteCommand createCommand = new SQLiteCommand(Query, sqlitecon); createCommand.ExecuteNonQuery();
SQLiteDataAdapter dataAdp = new SQLiteDataAdapter(createCommand);
DataTable dt = new DataTable("Customer_New");
dataAdp.Fill(dt);
datagrid_cindex.ItemsSource = dt.DefaultView; dataAdp.Update(dt);
sqlitecon.Close();

I need to select the primary key ID value from database table of selected row in DataGrid.

How to do it ? please Help ..
Posted
Updated 7-Oct-13 21:28pm
v2
Comments
Alexander Dymshyts 8-Oct-13 3:14am    
What have you done so far? Where in your code you have a problem?
Alexander Dymshyts 8-Oct-13 3:43am    
You need to make a query with some parameter(for example card_number), where you will look in all records in your database for a record with such parameter. When this record will be found, you will be able to access id field

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900