.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

incomplete Simple recursion code need help !!

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :ASP.Net
 

 

hi every one !!

it a simple problem .... someone with good recursion  understanding can do it but i fail Frown

for example i have a datatable with following data

ID ------------------- Name ------------------- ParentID

1 ------------------- Home ------------------- null

2 ------------------- Course ------------------- null

3 ------------------- .Net ------------------- 2

4 ------------------- C# ------------------- 3

5 ------------------- VB ------------------- 3

6 ------------------- MCTS ------------------- 4

7 ------------------- MCPD ------------------- 4

8 ------------------- Contact ------------------- null

 

the data available in table is for my web navigation "Menu" bar

i have to fetch the records from table and add according to the parent/child link

like Course --> C # --> MCTS

currently i am able to add first layer of child like Course --> C # but unable to make correctly add "MCTS" as a child of "C#"

by using following code

void addmenu(


View Complete Post


More Related Resource Links

Wicked Code: Silverlight Page Turning Made Simple

  

As we'll show, with just a few lines of JavaScript you can build a general-purpose framework for incorporating page turns into Silverlight 1.0 apps.

Jeff Prosise

MSDN Magazine May 2008


Secure Habits: 8 Simple Rules For Developing More Secure Code

  

Never trust data, model threats against your code, and other good advice from a security expert.

Michael Howard

MSDN Magazine November 2006


Simple Captcha Code in Javascript

  
The article Simple Captcha Code in Javascript was added by miya2008 on Tuesday, June 29, 2010.

Here I create a Cptcha Code With JavaScriptStep 1:->In the (.aspx) page we write the following Code:->%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>!DOCTYPE

Help: Too many lines of code to achieve a simple goal: keep my NULL SQL values...

  

Hello all

Question:
--------------
What is the best way (best practice) to preserve my NULL SQL values in the database
during an insert/update operation (without receiving cast invalid errors)?
Also, how to display a string 'n/a' when a sql value is NULL?

Description:
----------------
My project is using FormView with Edit/Insert templates and classes to represent my tables

Goals:
------------
Goal1....: display 'n/a' when there are NULL SQL values in the database
Solution1: I am using ISNULL(field,'') in my store procedure for SELECT statements

Goal2....: if the fields are 'n/a', then save them back in the database as NULL
Solution2: on my insert/edit methods I am having to check the values being passed, i.e:

cmd.Parameters.Add(new SqlParameter("@scope", SqlDbType.NVarChar, 50));

if (item.Scope == "n/a")
 cmd.Parameters["@scope"].Value = DBNull.Value;
else
 cmd.Parameters["@scope"].Value = item.Scope;


Not to mention that for SQL DateType fields when you use ISNULL(field,'') the return string is '1/1/1900 12:00:00 AM'
and I have to change the field value in every field that represents a date, i.e:

protected void FormView1_DataBound(object sender, Sy

HOW TO WRITE THIS SIMPLE CODE?

  
HI. I NEED LITTLE HELP. I have values 1000,2000,3000, wich located in numValue. Now I have sql table CUSTOM1 with column CUSTOM_ID where located numbers 1000,1001,2005,2006 .. Now if I choose( NumValue == 1000) go to sql table and find Maximum number wich begin with 1000 and add 1 = Result must be 1002 there is my code what change I must do in order to receive the num max + 1?       DataTable dt = new DataTable();         SqlConnection con = new SqlConnection("Data Source=DYS-PC;Initial Catalog=Veolia;Integrated Security=True");         SqlCommand cmd = new SqlCommand("Select Count(*) " + "FROM [MHGROUP].CUSTOM1 " + "WHERE CUSTOM_ALIAS = '" + comboBox2.Text + "'", con);         SqlDataAdapter sqlDa2 = new SqlDataAdapter();         sqlDa2.SelectCommand = cmd;         sqlDa2.Fill(dt);      

what is wrong with the below simple code?

  

in a button click I am trying to display a modal popup window
so in the ,cs side button1_click

 Modalpopupextender2.show();

But it is not displaying any thing on the button click. What is missing?

 

<style type="text/css">
     .modalBackground
    {
              background-color:Grey;
              /*Olive; */
              filter:alpha(opacity=70);
              opacity:0.7;
    }
   
     .modalPopup
    {
              background-color:#ffffdd;
              border-width:3px;
              border-style:solid;
              border-color:Gray;
              pad

How could Transfer a simple object that is created in asp.net to java script code and worked with it

  

Hi Experts.

I have a simple call in asp.net code behind. There are two variable i, j and some methods in . Like:

Class Test()

{              int i; string str;

                Public getI(int){//.}

Public getJ(int){//.}

}

Is there any way to have the same class in javascript? I want to create a simple object form this class and initiated its variables and passed it to javascript code and worked with it? How can I do it?

Thanks


How can i return a value from a simple WebForm.aspx to javascript code.

  

Hi Experts.

How can solve this problem; Suppose you write a simple JavaScript code in form tag like this:

<script  language="javascript">

                Var type="100";

                Var result = ';

Var iframe = '<iframe src="WebForm1.aspx?"t=' + type + '"></iframe>';

Document.write(iframe);           // call WebForm1.aspx in iframe tag

Document.write(result);            //write the result that return from WebForm1.aspx

</script>

I want return the value from WebForm1.aspx and save it in result variable. How can I do?How can i return a value from WebForm1.aspx and save it in result variable?

With Regards.Mojtaba


Simple C# code does not work

  

Hi everyone,

How can I put the C# code into the htm file ? Then following
code does not work. How can I make it work ?

Thanks,

Cecilia

-------------- begin RSSTable.htm ---------------

ProductId = <%= Request.Params.Get("ProductId") %>


-------------- end RSSTable.htm ----------------


Very Simple JQuery code does not work

  

Hi everyone,

How come the following code does not work ?  If you can, please make the following code to work for me.

Thanks,

Cecilia

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CookiePage1.aspx.cs" Inherits="CookiePage1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript">

        function SetCookie(T) {

            //Create (or update) the value of a cookie to expire in 2 days:
            $.cookie('ShoppingCartId', T, { expires: 2 });

        }

        function ReadCookie() {
            
            var SCId = $.cookie('ShoppingCartId');

            return SCId;

        }

        $(document).ready(function () {
            var T = "Testing Cookie";
            SetCookie(T);

            $('.MyShoppingCartId').append(ReadCookie());

        });       

</script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="MyShoppingCartId">       
    <

Slow but simple SQL Update command. I don't think its the code.

  
Hello Community,

The following is a very simple SQL statement that is running very slow, about 1-2 seconds. I have very complex Updates in the Assembly. This is without a doubt the most basic and runs the slowest. Others, as expected, feel instant. This one, hangs.

It is also the only SQL in the assembly that does not use cmd.Parameters.Add... code. So I removed the date update, I also removed the row self reference and the code, then i removed the WHERE .. broken all the way down to   "UPDATE vrxdata SET AccessCount=1" Still slow.

If you have questions about recordid:


[recordid] [int] IDENTITY(1000,1) PRIMARY KEY NOT NULL



Nothing else is going on in the software for this to happen. Software is idle, button_click to execute this code and wait...        



    publi

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Creating a Simple Class in C#

  
The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend