Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. the output of select command

the output of select command

Scheduled Pinned Locked Moved Database
helptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sara setare
    wrote on last edited by
    #1

    I have a table named(information)tha has 3 columns(id,fnam,lnam) I know that I can select an special row by

    select form information (id,fname,lname)WHERE id="1"
    ////I want to do this for example:
    string lname="last name witch it's id is "1"";
    ///and I want to access this by table

    plz help me!!!

    R 1 Reply Last reply
    0
    • S sara setare

      I have a table named(information)tha has 3 columns(id,fnam,lnam) I know that I can select an special row by

      select form information (id,fname,lname)WHERE id="1"
      ////I want to do this for example:
      string lname="last name witch it's id is "1"";
      ///and I want to access this by table

      plz help me!!!

      R Offline
      R Offline
      RobCollins
      wrote on last edited by
      #2

      You're probabyl going to be just fine with this

      SELECT id,fname,lname
      FROM information
      WHERE id = 1

      S 1 Reply Last reply
      0
      • R RobCollins

        You're probabyl going to be just fine with this

        SELECT id,fname,lname
        FROM information
        WHERE id = 1

        S Offline
        S Offline
        sara setare
        wrote on last edited by
        #3

        ok,but how can I access the fname as string ; my code is like this:

        protected void page_Load(object sender, EventArgs e)
        {
        //session["field3"] contains an Id from previous page
        Id.Value = (string)Session["field3"];
        }
        protected void salam(object sender,EventArgs e)
        {
        name.value="the row's name witch it's id is session["field3"]"

        }

        do you undrestand me?

        R 1 Reply Last reply
        0
        • S sara setare

          ok,but how can I access the fname as string ; my code is like this:

          protected void page_Load(object sender, EventArgs e)
          {
          //session["field3"] contains an Id from previous page
          Id.Value = (string)Session["field3"];
          }
          protected void salam(object sender,EventArgs e)
          {
          name.value="the row's name witch it's id is session["field3"]"

          }

          do you undrestand me?

          R Offline
          R Offline
          RobCollins
          wrote on last edited by
          #4

          Not really :(. Can you give me some more details on what specifically are you trying to do?

          S 1 Reply Last reply
          0
          • R RobCollins

            Not really :(. Can you give me some more details on what specifically are you trying to do?

            S Offline
            S Offline
            sara setare
            wrote on last edited by
            #5

            ok,I put all of codes here!

            ///In the getid.aspx page

            <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="authenticate1.aspx.cs" Inherits="hokm.Admin.authenticate1" %>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <script runat="server">

            protected void salam(object sender, EventArgs e)
            {
                Session\["field1"\] = sh1.Text;
                Response.Redirect("editinformation.aspx");
            }
            

            </script>
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head runat="server">
            <title></title>
            </head>
            <body>
            <form id="form1" runat="server" enctype="multipart/form-data" >
            <div dir="rtl">
            <table>
            <tr class="style1">
            <td width="3%" bgcolor="#FF6666">
            Please enter your id number
            <br />
            <br />
            <asp:TextBox name="shomare" ID="sh1" runat="server"/>
            <br />
            <br />
            <asp:Button ID="Button1" Width="60" runat="server" Text="confirm" OnClick="salam" />
            </td>
            </tr>
            </table>
            </div>
            </form>
            </body>
            </html>

            so I put the Id in session["field1"];
            and in the editinformation.aspx

            protected void page\_Load(object sender, EventArgs e)
            {
                sh.Value = (string)Session\["field3"\];
             
                
            }
            

            <td colspan="5"> 
            ID number:
            <input name="shomare karmandy" disabled="disabled" id ="sh" runat="server" />
            </td>

            name:

            you see that I have filled the id textbox with a value,and I want to do this with name input,but I dont know how should I use the database to access the name with this Id?????

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups