I am new to ADO.net. I have learned programming in Connected mode. Now i am learning ADO.net disconnected mode. I am facing a problem now:- I have a datatable name "Info". It has four fields :- "ID","Name","Address". Now i want that when user write a ID number and click on button then other two textboxes will show corresponding Name and address. I think SQL statement should be like
SqlCommand cmd = new SqlCommand();
Cmd.CommandText = "Select Name, Address from Info where ID = @id";
I am writing above code using my connected mode ADO.net Experience. We used a Datareader in Connected mode. But we cannot use DATAREADER in Disconnected mode so how can it be done. Please help me..
Also told me a good link where i can learn INSERT, UPDATE and Delete operation using (i)SQLDataAdapter (ii) SqlCommandBuilder
I have googled alot for good tutorial but everyone has own style of coding and logic therefore i am really confused...
That looks OK to me (I'm olde school). Aren't you expecting only one record back? So read it with a DataReader and disconnect. What's the problem?
However, I wonder why the user would need to enter an ID -- in my opinion users should never know any IDs.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)