Click here to Skip to main content
14,548,964 members
   

ASP.NET

 
AnswerRe: Javascript validation in asp.net for a textbox and dropdown Pin
Christian Graus15-Sep-09 21:15
mveChristian Graus15-Sep-09 21:15 
AnswerRe: Javascript validation in asp.net for a textbox and dropdown Pin
Abhishek Sur15-Sep-09 21:52
professionalAbhishek Sur15-Sep-09 21:52 
GeneralRe: Javascript validation in asp.net for a textbox and dropdown Pin
Christian Graus15-Sep-09 21:57
mveChristian Graus15-Sep-09 21:57 
GeneralRe: Javascript validation in asp.net for a textbox and dropdown Pin
Abhishek Sur15-Sep-09 22:09
professionalAbhishek Sur15-Sep-09 22:09 
GeneralRe: Javascript validation in asp.net for a textbox and dropdown Pin
Christian Graus15-Sep-09 22:10
mveChristian Graus15-Sep-09 22:10 
GeneralRe: Javascript validation in asp.net for a textbox and dropdown Pin
Abhishek Sur15-Sep-09 22:43
professionalAbhishek Sur15-Sep-09 22:43 
AnswerRe: Javascript validation in asp.net for a textbox and dropdown Pin
Arun Jacob15-Sep-09 22:51
MemberArun Jacob15-Sep-09 22:51 
QuestionProblem in populating a treeview from database Pin
rinku soni 2315-Sep-09 20:23
Memberrinku soni 2315-Sep-09 20:23 
Hellon every one.I have a table as follow;



Node_Id Node_Name Parent_Id
1 Classified 0
2 Job 1
3 Matrimony 1
4 Property 1
5 ChildofJob1 2
6 Childofjob2 2

i am using following code,but its not giving me proper structure.

My logic is,i add the node in to treeview at the same time i also check is this node present into Arraylist or not,if yes then i don't add that node if no then add the node to treeview as well as arraylist also.This procedure used for each and every node of tree.






// For database operation

OdbcConnection con = CodeClass.GetConnetion();
OdbcDataAdapter adapter1 = new OdbcDataAdapter("select * from AdminAddNewItem ", con);
OdbcDataAdapter adapter2 = new OdbcDataAdapter("select * from AdminAddNewItem ", con);
DataSet ds = new DataSet();
adapter1.Fill(ds, "Parent");
adapter2.Fill(ds, "Child");
ds.Relations.Add("relation", ds.Tables["Parent"].Columns["Node_Id"], ds.Tables["Child"].Columns["Parent_Id"]);
// ========================================================================================




//I am takeing a arraylist in which i am going to maintan all nodes
ArrayList list = new ArrayList();
string listitem;
int flage1 = 0;
int flage2 = 0;








//=============================
foreach (DataRow Prow in ds.Tables["Parent"].Rows)
{

// code for add parent nodes
TreeNode pnode = new TreeNode(Prow["Node_Name"].ToString(), Prow["Parent_Id"].ToString());



//code for chech whather the node already present or not

for (int i = 0; i < list.Count; i++)
{

if (pnode.Text.ToString() == list[i].ToString ())
{
flage1++;
break;
}

}
if (flage1 > 0)
{

flage1 = 0;
Response.Write("Node already exist");

}

else
{

TreeView1.Nodes.Add(pnode);
list.Add(pnode.Text.ToString());
}


//code for add Child nodes
// if (Prow.GetChildRows("relation") != null)
{
foreach (DataRow Crow in Prow.GetChildRows("relation"))
{
TreeNode Childnode = new TreeNode(Crow["Node_Name"].ToString());
pnode.ChildNodes.Add(Childnode);
list.Add(Childnode.Text .ToString ());
}
}

}
AnswerRe: Problem in populating a treeview from database Pin
Abhijit Jana15-Sep-09 20:27
professionalAbhijit Jana15-Sep-09 20:27 
AnswerRe: Problem in populating a treeview from database Pin
Christian Graus15-Sep-09 21:18
mveChristian Graus15-Sep-09 21:18 
AnswerRe: Problem in populating a treeview from database Pin
N a v a n e e t h15-Sep-09 22:08
MemberN a v a n e e t h15-Sep-09 22:08 
GeneralRe: Problem in populating a treeview from database Pin
Abhishek Sur15-Sep-09 22:11
professionalAbhishek Sur15-Sep-09 22:11 
GeneralRe: Problem in populating a treeview from database Pin
N a v a n e e t h15-Sep-09 22:14
MemberN a v a n e e t h15-Sep-09 22:14 
QuestionHow dynamic objects work during a post back Pin
compninja2515-Sep-09 14:58
Membercompninja2515-Sep-09 14:58 
AnswerRe: How dynamic objects work during a post back Pin
Christian Graus15-Sep-09 15:00
mveChristian Graus15-Sep-09 15:00 
GeneralRe: How dynamic objects work during a post back Pin
compninja2515-Sep-09 16:13
Membercompninja2515-Sep-09 16:13 
GeneralRe: How dynamic objects work during a post back Pin
N a v a n e e t h15-Sep-09 16:18
MemberN a v a n e e t h15-Sep-09 16:18 
GeneralRe: How dynamic objects work during a post back Pin
compninja2516-Sep-09 2:08
Membercompninja2516-Sep-09 2:08 
GeneralRe: How dynamic objects work during a post back Pin
Christian Graus15-Sep-09 16:19
mveChristian Graus15-Sep-09 16:19 
GeneralRe: How dynamic objects work during a post back Pin
Abhijit Jana15-Sep-09 18:26
professionalAbhijit Jana15-Sep-09 18:26 
AnswerRe: How dynamic objects work during a post back Pin
Arun Jacob15-Sep-09 18:58
MemberArun Jacob15-Sep-09 18:58 
GeneralRe: How dynamic objects work during a post back Pin
Abhijit Jana15-Sep-09 19:08
professionalAbhijit Jana15-Sep-09 19:08 
GeneralRe: How dynamic objects work during a post back Pin
r a m e s h15-Sep-09 20:39
Memberr a m e s h15-Sep-09 20:39 
GeneralRe: How dynamic objects work during a post back Pin
compninja2516-Sep-09 2:21
Membercompninja2516-Sep-09 2:21 
QuestionPassing Credentials from ASP.NET to OWA Pin
ahayw0115-Sep-09 12:51
Memberahayw0115-Sep-09 12:51 

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.