Click here to Skip to main content
15,910,083 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error handling Pin
Christian Graus9-Jan-07 16:04
protectorChristian Graus9-Jan-07 16:04 
GeneralRe: Error handling Pin
JoeRip9-Jan-07 18:12
JoeRip9-Jan-07 18:12 
GeneralRe: Error handling Pin
JoeRip9-Jan-07 18:25
JoeRip9-Jan-07 18:25 
GeneralRe: Error handling Pin
Scott Dorman9-Jan-07 18:33
professionalScott Dorman9-Jan-07 18:33 
GeneralRe: Error handling Pin
Christian Graus9-Jan-07 18:42
protectorChristian Graus9-Jan-07 18:42 
GeneralRe: Error handling Pin
Martin Sp.10-Jan-07 3:41
Martin Sp.10-Jan-07 3:41 
QuestionTree View and Database Pin
64-bit9-Jan-07 14:49
64-bit9-Jan-07 14:49 
AnswerRe: Tree View and Database Pin
Judah Gabriel Himango9-Jan-07 15:42
sponsorJudah Gabriel Himango9-Jan-07 15:42 
You can read data from the database using the System.Data.SqlClient.DataReader class to read data from your database. Once you have that data, you can create tree nodes from that data, then add those nodes to the treeview. Here's some idea of what this would look like:

SqlConnection connection = new SqlConnection("your connection string goes here");
SqlCommand myCommand = new SqlCommand("Select * from MyTable");
myCommand.Connection = connection;
SqlDataReader reader = myCommand.ExecuteReader();
while(reader.Reader())
{
   // This will pull a string from the first column in the MyTable
   string nodeText = reader.GetString(0);

   // This will create a tree node and add it to the tree view. 
   TreeNode node = new TreeNode(nodeText);
   myTreeView.Nodes.Add(node);
}


connection.Dispose();
myCommand.Dispose();
reader.Dispose();


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Guess who's having a birthday? (It's not Jesus)
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: Tree View and Database Pin
64-bit9-Jan-07 17:35
64-bit9-Jan-07 17:35 
GeneralRe: Tree View and Database Pin
Judah Gabriel Himango9-Jan-07 17:37
sponsorJudah Gabriel Himango9-Jan-07 17:37 
QuestionWhy is my app using so much memory? Pin
Anthony Mushrow9-Jan-07 11:51
professionalAnthony Mushrow9-Jan-07 11:51 
AnswerRe: Why is my app using so much memory? Pin
Luc Pattyn9-Jan-07 11:58
sitebuilderLuc Pattyn9-Jan-07 11:58 
GeneralRe: Why is my app using so much memory? Pin
Anthony Mushrow9-Jan-07 12:01
professionalAnthony Mushrow9-Jan-07 12:01 
GeneralRe: Why is my app using so much memory? Pin
Luc Pattyn9-Jan-07 12:06
sitebuilderLuc Pattyn9-Jan-07 12:06 
AnswerRe: Why is my app using so much memory? Pin
DavidNohejl9-Jan-07 12:11
DavidNohejl9-Jan-07 12:11 
AnswerRe: Why is my app using so much memory? Pin
Christian Graus9-Jan-07 12:15
protectorChristian Graus9-Jan-07 12:15 
AnswerRe: Why is my app using so much memory? Pin
Anthony Mushrow9-Jan-07 12:24
professionalAnthony Mushrow9-Jan-07 12:24 
Questioncrystal reports vs MSSQL 2000 server Reporting services Pin
samuelred9-Jan-07 10:39
samuelred9-Jan-07 10:39 
QuestionBooks on OOPS and C# Pin
Blumen9-Jan-07 8:22
Blumen9-Jan-07 8:22 
AnswerRe: Books on OOPS and C# Pin
led mike9-Jan-07 9:25
led mike9-Jan-07 9:25 
GeneralWhile I like Wrox publishing Pin
Ennis Ray Lynch, Jr.9-Jan-07 13:34
Ennis Ray Lynch, Jr.9-Jan-07 13:34 
GeneralRe: While I like Wrox publishing Pin
Christian Graus9-Jan-07 16:05
protectorChristian Graus9-Jan-07 16:05 
GeneralRe: While I like Wrox publishing Pin
led mike10-Jan-07 6:05
led mike10-Jan-07 6:05 
GeneralProfessional Pin
Ennis Ray Lynch, Jr.10-Jan-07 6:43
Ennis Ray Lynch, Jr.10-Jan-07 6:43 
GeneralRe: Professional Pin
led mike10-Jan-07 12:22
led mike10-Jan-07 12:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.