asp.net and sql server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amjad

    asp.net and sql server

    how to connection sql server table with aspx like pulling data from table to
    grid view.... simple example to start ....
    thanks
  • Harvey Triana

    #2
    Re: asp.net and sql server

    On "Microsoft Visual Studio 2005 Documentation" look for:

    Visual Web Developer
    Walkthrough: Basic Data Access in Web Pages

    <Harvey Triana />


    "amjad" <amjad@discussi ons.microsoft.c om> escribió en el mensaje
    news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=blue]
    > how to connection sql server table with aspx like pulling data from table
    > to
    > grid view.... simple example to start ....
    > thanks[/color]


    Comment

    • Winista

      #3
      Re: asp.net and sql server

      See if this helps and gets you started..




      "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
      news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=blue]
      > how to connection sql server table with aspx like pulling data from table
      > to
      > grid view.... simple example to start ....
      > thanks[/color]


      Comment

      • Juan T. Llibre

        #4
        Re: asp.net and sql server

        For SQL Server 2000 / ASP.NET 1.1 :



        For SQL Server 2005 / ASP.NET 2.0 :

        Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.





        Juan T. Llibre, asp.net MVP
        aspnetfaq.com : http://www.aspnetfaq.com/
        asp.net faq : http://asp.net.do/faq/
        foros de asp.net, en español : http://asp.net.do/foros/
        =============== =============== =====
        "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
        news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=blue]
        > how to connection sql server table with aspx like pulling data from table to
        > grid view.... simple example to start ....
        > thanks[/color]


        Comment

        • amjad

          #5
          Re: asp.net and sql server

          I have used the link below and try to run the example
          "http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"
          but it giving me the error i dont have any idea whats wrong seem to be olrite
          but still got error my sqlserver is on ip 10.0.0.2
          here is the connection string
          SqlConnection myConnection = new
          SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;
          SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",
          myConnection);

          DataSet ds = new DataSet();
          myCommand.Fill( ds, "Authors");

          MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;
          MyDataGrid.Data Bind();
          any one has any idea whats wrong thanks
          "Juan T. Llibre" wrote:
          [color=blue]
          > For SQL Server 2000 / ASP.NET 1.1 :
          >
          > http://samples.gotdotnet.com/quickstart/aspplus/
          >
          > For SQL Server 2005 / ASP.NET 2.0 :
          >
          > http://asp.net/QuickStart/aspnet/doc/data/default.aspx
          >
          >
          >
          >
          > Juan T. Llibre, asp.net MVP
          > aspnetfaq.com : http://www.aspnetfaq.com/
          > asp.net faq : http://asp.net.do/faq/
          > foros de asp.net, en español : http://asp.net.do/foros/
          > =============== =============== =====
          > "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
          > news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=green]
          > > how to connection sql server table with aspx like pulling data from table to
          > > grid view.... simple example to start ....
          > > thanks[/color]
          >
          >
          >[/color]

          Comment

          • Ray Booysen

            #6
            Re: asp.net and sql server

            You haven't opened the connection anywhere.


            amjad wrote:[color=blue]
            > I have used the link below and try to run the example
            > "http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"
            > but it giving me the error i dont have any idea whats wrong seem to be olrite
            > but still got error my sqlserver is on ip 10.0.0.2
            > here is the connection string
            > SqlConnection myConnection = new
            > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;
            > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",
            > myConnection);
            >
            > DataSet ds = new DataSet();
            > myCommand.Fill( ds, "Authors");
            >
            > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;
            > MyDataGrid.Data Bind();
            > any one has any idea whats wrong thanks
            > "Juan T. Llibre" wrote:
            >[color=green]
            >> For SQL Server 2000 / ASP.NET 1.1 :
            >>
            >> http://samples.gotdotnet.com/quickstart/aspplus/
            >>
            >> For SQL Server 2005 / ASP.NET 2.0 :
            >>
            >> http://asp.net/QuickStart/aspnet/doc/data/default.aspx
            >>
            >>
            >>
            >>
            >> Juan T. Llibre, asp.net MVP
            >> aspnetfaq.com : http://www.aspnetfaq.com/
            >> asp.net faq : http://asp.net.do/faq/
            >> foros de asp.net, en español : http://asp.net.do/foros/
            >> =============== =============== =====
            >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
            >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=darkred]
            >>> how to connection sql server table with aspx like pulling data from table to
            >>> grid view.... simple example to start ....
            >>> thanks[/color]
            >>
            >>[/color][/color]

            Comment

            • Juan T. Llibre

              #7
              Re: asp.net and sql server

              re:[color=blue]
              > but still got error my sqlserver is on ip 10.0.0.2
              > ("server=10.0.0 .2;database=MyD atabase;Trusted _Connection=yes ");[/color]

              Is the SQL Server (2000 or MSDE?) on the same computer as your web server ?
              If so, use the SQL Server's instance name, not the IP, in the connection.

              SqlConnection(" server=MachineN ame\NetSDK;UID= username;databa se=DBName;PWD=p assword");
              or
              SqlConnection(" server=MachineN ame\NetSDK;data base=MyDatabase ;Trusted_Connec tion=yes");
              ( MachineName\Net SDK is the default instance name for MSDE/SQL Server 2000 )

              or
              SqlConnection(" server=SqlServe rInstanceName;d atabase=MyDatab ase;Trusted_Con nection=yes");

              If you're using Sql Server 2005, or Sql Server Express 2005, it's a bit different than this.




              Juan T. Llibre, asp.net MVP
              aspnetfaq.com : http://www.aspnetfaq.com/
              asp.net faq : http://asp.net.do/faq/
              foros de asp.net, en español : http://asp.net.do/foros/
              =============== =============== =====
              "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
              news:8023CFF4-0E77-4C5B-8D92-B855145F26A3@mi crosoft.com...[color=blue]
              >I have used the link below and try to run the example
              > "http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"
              > but it giving me the error i dont have any idea whats wrong seem to be olrite
              > but still got error my sqlserver is on ip 10.0.0.2
              > here is the connection string
              > SqlConnection myConnection = new
              > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;
              > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",
              > myConnection);
              >
              > DataSet ds = new DataSet();
              > myCommand.Fill( ds, "Authors");
              >
              > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;
              > MyDataGrid.Data Bind();
              > any one has any idea whats wrong thanks
              > "Juan T. Llibre" wrote:
              >[color=green]
              >> For SQL Server 2000 / ASP.NET 1.1 :
              >>
              >> http://samples.gotdotnet.com/quickstart/aspplus/
              >>
              >> For SQL Server 2005 / ASP.NET 2.0 :
              >>
              >> http://asp.net/QuickStart/aspnet/doc/data/default.aspx
              >>
              >>
              >>
              >>
              >> Juan T. Llibre, asp.net MVP
              >> aspnetfaq.com : http://www.aspnetfaq.com/
              >> asp.net faq : http://asp.net.do/faq/
              >> foros de asp.net, en español : http://asp.net.do/foros/
              >> =============== =============== =====
              >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
              >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...[color=darkred]
              >> > how to connection sql server table with aspx like pulling data from table to
              >> > grid view.... simple example to start ....
              >> > thanks[/color]
              >>
              >>
              >>[/color][/color]


              Comment

              • amjad

                #8
                Re: asp.net and sql server

                forget to mention tat i am using sql server 2005

                "Juan T. Llibre" wrote:
                [color=blue]
                > re:[color=green]
                > > but still got error my sqlserver is on ip 10.0.0.2
                > > ("server=10.0.0 .2;database=MyD atabase;Trusted _Connection=yes ");[/color]
                >
                > Is the SQL Server (2000 or MSDE?) on the same computer as your web server ?
                > If so, use the SQL Server's instance name, not the IP, in the connection.
                >
                > SqlConnection(" server=MachineN ame\NetSDK;UID= username;databa se=DBName;PWD=p assword");
                > or
                > SqlConnection(" server=MachineN ame\NetSDK;data base=MyDatabase ;Trusted_Connec tion=yes");
                > ( MachineName\Net SDK is the default instance name for MSDE/SQL Server 2000 )
                >
                > or
                > SqlConnection(" server=SqlServe rInstanceName;d atabase=MyDatab ase;Trusted_Con nection=yes");
                >
                > If you're using Sql Server 2005, or Sql Server Express 2005, it's a bit different than this.
                >
                >
                >
                >
                > Juan T. Llibre, asp.net MVP
                > aspnetfaq.com : http://www.aspnetfaq.com/
                > asp.net faq : http://asp.net.do/faq/
                > foros de asp.net, en español : http://asp.net.do/foros/
                > =============== =============== =====
                > "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
                > news:8023CFF4-0E77-4C5B-8D92-B855145F26A3@mi crosoft.com...[color=green]
                > >I have used the link below and try to run the example
                > > "http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"
                > > but it giving me the error i dont have any idea whats wrong seem to be olrite
                > > but still got error my sqlserver is on ip 10.0.0.2
                > > here is the connection string
                > > SqlConnection myConnection = new
                > > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;
                > > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",
                > > myConnection);
                > >
                > > DataSet ds = new DataSet();
                > > myCommand.Fill( ds, "Authors");
                > >
                > > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;
                > > MyDataGrid.Data Bind();
                > > any one has any idea whats wrong thanks
                > > "Juan T. Llibre" wrote:
                > >[color=darkred]
                > >> For SQL Server 2000 / ASP.NET 1.1 :
                > >>
                > >> http://samples.gotdotnet.com/quickstart/aspplus/
                > >>
                > >> For SQL Server 2005 / ASP.NET 2.0 :
                > >>
                > >> http://asp.net/QuickStart/aspnet/doc/data/default.aspx
                > >>
                > >>
                > >>
                > >>
                > >> Juan T. Llibre, asp.net MVP
                > >> aspnetfaq.com : http://www.aspnetfaq.com/
                > >> asp.net faq : http://asp.net.do/faq/
                > >> foros de asp.net, en español : http://asp.net.do/foros/
                > >> =============== =============== =====
                > >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
                > >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...
                > >> > how to connection sql server table with aspx like pulling data from table to
                > >> > grid view.... simple example to start ....
                > >> > thanks
                > >>
                > >>
                > >>[/color][/color]
                >
                >
                >[/color]

                Comment

                • Juan T. Llibre

                  #9
                  Re: asp.net and sql server

                  You also forgot to say whether the SQL Server 2005
                  is on the same computer as your web server.




                  Juan T. Llibre, asp.net MVP
                  aspnetfaq.com : http://www.aspnetfaq.com/
                  asp.net faq : http://asp.net.do/faq/
                  foros de asp.net, en español : http://asp.net.do/foros/
                  =============== =============== =====
                  "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
                  news:FB40918A-6879-4CA2-884B-D01B8D12A2AF@mi crosoft.com...[color=blue]
                  > forget to mention tat i am using sql server 2005
                  >
                  > "Juan T. Llibre" wrote:
                  >[color=green]
                  >> re:[color=darkred]
                  >> > but still got error my sqlserver is on ip 10.0.0.2
                  >> > ("server=10.0.0 .2;database=MyD atabase;Trusted _Connection=yes ");[/color]
                  >>
                  >> Is the SQL Server (2000 or MSDE?) on the same computer as your web server ?
                  >> If so, use the SQL Server's instance name, not the IP, in the connection.
                  >>
                  >> SqlConnection(" server=MachineN ame\NetSDK;UID= username;databa se=DBName;PWD=p assword");
                  >> or
                  >> SqlConnection(" server=MachineN ame\NetSDK;data base=MyDatabase ;Trusted_Connec tion=yes");
                  >> ( MachineName\Net SDK is the default instance name for MSDE/SQL Server 2000 )
                  >>
                  >> or
                  >> SqlConnection(" server=SqlServe rInstanceName;d atabase=MyDatab ase;Trusted_Con nection=yes");
                  >>
                  >> If you're using Sql Server 2005, or Sql Server Express 2005, it's a bit different than this.
                  >>
                  >>
                  >>
                  >>
                  >> Juan T. Llibre, asp.net MVP
                  >> aspnetfaq.com : http://www.aspnetfaq.com/
                  >> asp.net faq : http://asp.net.do/faq/
                  >> foros de asp.net, en español : http://asp.net.do/foros/
                  >> =============== =============== =====
                  >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
                  >> news:8023CFF4-0E77-4C5B-8D92-B855145F26A3@mi crosoft.com...[color=darkred]
                  >> >I have used the link below and try to run the example
                  >> > "http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"
                  >> > but it giving me the error i dont have any idea whats wrong seem to be olrite
                  >> > but still got error my sqlserver is on ip 10.0.0.2
                  >> > here is the connection string
                  >> > SqlConnection myConnection = new
                  >> > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;
                  >> > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",
                  >> > myConnection);
                  >> >
                  >> > DataSet ds = new DataSet();
                  >> > myCommand.Fill( ds, "Authors");
                  >> >
                  >> > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;
                  >> > MyDataGrid.Data Bind();
                  >> > any one has any idea whats wrong thanks
                  >> > "Juan T. Llibre" wrote:
                  >> >
                  >> >> For SQL Server 2000 / ASP.NET 1.1 :
                  >> >>
                  >> >> http://samples.gotdotnet.com/quickstart/aspplus/
                  >> >>
                  >> >> For SQL Server 2005 / ASP.NET 2.0 :
                  >> >>
                  >> >> http://asp.net/QuickStart/aspnet/doc/data/default.aspx
                  >> >>
                  >> >>
                  >> >>
                  >> >>
                  >> >> Juan T. Llibre, asp.net MVP
                  >> >> aspnetfaq.com : http://www.aspnetfaq.com/
                  >> >> asp.net faq : http://asp.net.do/faq/
                  >> >> foros de asp.net, en español : http://asp.net.do/foros/
                  >> >> =============== =============== =====
                  >> >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message
                  >> >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...
                  >> >> > how to connection sql server table with aspx like pulling data from table to
                  >> >> > grid view.... simple example to start ....
                  >> >> > thanks
                  >> >>
                  >> >>
                  >> >>[/color]
                  >>
                  >>
                  >>[/color][/color]


                  Comment

                  • Juan T. Llibre

                    #10
                    Re: asp.net and sql server

                    You're going to run into problems if you want to use SQL Server 2005
                    to run the .Net Framework SDK 1.1 data access examples.

                    1. You need the Pubs database. Is it installed ?

                    After you've downloaded and installed SQL Server 2005 Express,
                    if you want to install the sample Pubs and Northwind databases,
                    double-click the .msi version of the file from the following link:



                    This installs two T-SQL scripts that you must run to build the databases.

                    You can use either the built-in SQLCMD command line tool or you can use
                    Query Editor from SQL Server Management Studio.

                    The following two command examples let you use SQLCMD
                    to install the sample databases to the local system:

                    SQLCMD -E -i "C:\PathToTheDo wnloadedSampleD atabases\instpu bs.sql"
                    SQLCMD -E -i "C:\PathToTheDo wnloadedSampleD atabases\instnw nd.sql"

                    SQL Server Management Studio is available at :


                    Microsoft also provides a free SQL Server Express Utility-SSEUtil.

                    This downloadable tool lets you list all installed instances of SQL Server Express;
                    connect to an instance; and create, attach, and detach databases as well as execute
                    SQL statements. Check out SSEUtil at:

                    http://www.microsoft.com/downloads/d...laylang=enMake sure you bookmark this page :http://www.connectionstrings.com/Click on the SQL Server 2005 icon and then on the Sql Connection (.Net ) iconfor a bunch of connection strings for SQL Server Express 2005.Which one is the right one depends on your setup and what you want to do.Good luck!Juan T. Llibre, asp.net MVPaspnetfaq.co m : http://www.aspnetfaq.com/asp.net faq : http://asp.net.do/faq/foros de asp.net, en español : http://asp.net.do/foros/=============== =============== ====="amjad" <amjad@discussi ons.microsoft.c om> wrote in messagenews:FB4 0918A-6879-4CA2-884B-D01B8D12A2AF@mi crosoft.com...> forget to mention tat i am using sql server 2005>> "Juan T. Llibre" wrote:>>> re:>> > but still got error my sqlserver is on ip 10.0.0.2>> > ("server=10.0.0 .2;database=MyD atabase;Trusted _Connection=yes ");>>>> Is the SQL Server (2000 or MSDE?) on the same computer as your web server ?>> If so, use the SQL Server's instance name, not the IP, in the connection.>>>> SqlConnection(" server=MachineN ame\NetSDK;UID= username;databa se=DBName;PWD=p assword");>> or>> SqlConnection(" server=MachineN ame\NetSDK;data base=MyDatabase ;Trusted_Connec tion=yes");>> ( MachineName\Net SDK is the default instance name for MSDE/SQL Server 2000 )>>>> or>> SqlConnection(" server=SqlServe rInstanceName;d atabase=MyDatab ase;Trusted_Con nection=yes");> >>> If you're using Sql Server 2005, or Sql Server Express 2005, it's a bit different than this.>>>>>>>>>> Juan T. Llibre, asp.net MVP>> aspnetfaq.com : http://www.aspnetfaq.c om/>> asp.net faq : http://asp.net.do/faq/>> foros de asp.net, en español : http://asp.net.do/foros/>> =============== =============== =====>> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message>> news:8023CFF4-0E77-4C5B-8D92-B855145F26A3@mi crosoft.com...> > >I have used the link below and try to run the example>> >"http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"> > > but it giving me the error i dont have any idea whats wrong seem to be olrite>> > but still got error my sqlserver is on ip 10.0.0.2>> > here is the connection string>> > SqlConnection myConnection = new>> > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;>> > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",>> > myConnection);> > >>> > DataSet ds = new DataSet();>> > myCommand.Fill( ds, "Authors"); >> >>> > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;>> > MyDataGrid.Data Bind();>> > any one has any idea whats wrong thanks>> > "Juan T. Llibre" wrote:>> >>> >> For SQL Server 2000 / ASP.NET 1.1 :>> >>>> >> http://samples.gotdotn et.com/quickstart/aspplus/>> >>>> >> For SQL Server 2005 / ASP.NET 2.0 :>> >>>> >> http://asp.net/QuickStart/aspnet/doc/data/default.aspx>> >>>> >>>> >>>> >>>> >> Juan T. Llibre, asp.net MVP>> >> aspnetfaq.com : http://www.aspnetfaq.c om/>> >> asp.net faq : http://asp.net.do/faq/>> >> foros de asp.net, en español : http://asp.net.do/foros/>> >> =============== =============== =====>> >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message>> >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...> > >> > how to connection sql server table with aspx like pulling data from table to>> >> > grid view.... simple example to start ....>> >> > thanks>> >>>> >>>> >>>>>>>>

                    Comment

                    • amjad

                      #11
                      Re: asp.net and sql server

                      My webserver is on different server and sql server 2005 is on different
                      server ..i am not using sql express 2005 instead full sql server 2005..
                      thanks

                      "Juan T. Llibre" wrote:
                      [color=blue]
                      > You're going to run into problems if you want to use SQL Server 2005
                      > to run the .Net Framework SDK 1.1 data access examples.
                      >
                      > 1. You need the Pubs database. Is it installed ?
                      >
                      > After you've downloaded and installed SQL Server 2005 Express,
                      > if you want to install the sample Pubs and Northwind databases,
                      > double-click the .msi version of the file from the following link:
                      >
                      > http://www.microsoft.com/downloads/d...displaylang=en
                      >
                      > This installs two T-SQL scripts that you must run to build the databases.
                      >
                      > You can use either the built-in SQLCMD command line tool or you can use
                      > Query Editor from SQL Server Management Studio.
                      >
                      > The following two command examples let you use SQLCMD
                      > to install the sample databases to the local system:
                      >
                      > SQLCMD -E -i "C:\PathToTheDo wnloadedSampleD atabases\instpu bs.sql"
                      > SQLCMD -E -i "C:\PathToTheDo wnloadedSampleD atabases\instnw nd.sql"
                      >
                      > SQL Server Management Studio is available at :
                      > http://www.microsoft.com/downloads/d...displaylang=en
                      >
                      > Microsoft also provides a free SQL Server Express Utility-SSEUtil.
                      >
                      > This downloadable tool lets you list all installed instances of SQL Server Express;
                      > connect to an instance; and create, attach, and detach databases as well as execute
                      > SQL statements. Check out SSEUtil at:
                      >
                      > http://www.microsoft.com/downloads/d...laylang=enMake sure you bookmark this page :http://www.connectionstrings.com/Click on the SQL Server 2005 icon and then on the Sql Connection (.Net ) iconfor a bunch of connection strings for SQL Server Express 2005.Which one is the right one depends on your setup and what you want to do.Good luck!Juan T. Llibre, asp.net MVPaspnetfaq.co m : http://www.aspnetfaq.com/asp.net faq : http://asp.net.do/faq/foros de asp.net, en español : http://asp.net.do/foros/=============== =============== ====="amjad" <amjad@discussi ons.microsoft.c om> wrote in messagenews:FB4 0918A-6879-4CA2-884B-D01B8D12A2AF@mi crosoft.com...> forget to mention tat i am using sql server 2005>> "Juan T. Llibre" wrote:>>> re:>> > but still got error my sqlserver is on ip 10.0.0.2>> > ("server=10.0.0 .2;database=MyD atabase;Trusted _Connection=yes ");>>>> Is the SQL Server (2000 or MSDE?) on the same computer as your web server[/color]
                      ?>> If so, use the SQL Server's instance name, not the IP, in the connection.>>>> SqlConnection(" server=MachineN ame\NetSDK;UID= username;databa se=DBName;PWD=p assword");>> or>> SqlConnection(" server=MachineN ame\NetSDK;data base=MyDatabase ;Trusted_Connec tion=yes");>> ( MachineName\Net SDK is the default instance name for MSDE/SQL Server 2000 )>>>> or>> SqlConnection(" server=SqlServe rInstanceName;d atabase=MyDatab ase;Trusted_Con nection=yes");> >>> If you're using Sql Server 2005, or Sql Server Express 2005, it's a bit different than this.>>>>>>>>>> Juan T. Llibre, asp.net MVP>> aspnetfaq.com : http://www.aspnetfaq.c om/>> asp.net faq : http://asp.net.do/faq/>> foros de asp.net, en español : http://asp.net.do/foros/>> =============== =============== =====>> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message>> news:8023CFF4-0E77-4C5B-8D92-B855145F26A3@mi crosoft.com...> > >I have used the link below and try to run the example>>[color=blue]
                      >"http://samples.gotdotn et.com/quickstart/util/srcview.aspx?pa th=/quickstart/aspplus/samples/webforms/data/datagrid1.src&f ile=CS\datagrid 1.aspx&font=3"> > > but it giving me the error i dont have any idea whats wrong seem to be olrite>> > but still got error my sqlserver is on ip 10.0.0.2>> > here is the connection string>> > SqlConnection myConnection = new>> > SqlConnection(" server=10.0.0.2 ;database=MyDat abase;Trusted_C onnection=yes") ;>> > SqlDataAdapter myCommand = new SqlDataAdapter( "select * from Authors",>> > myConnection);> > >>> > DataSet ds = new DataSet();>> > myCommand.Fill( ds, "Authors"); >> >>> > MyDataGrid.Data Source=ds.Table s["Authors"].DefaultView;>> > MyDataGrid.Data Bind();>> > any one has any idea whats wrong thanks>> > "Juan T. Llibre" wrote:>> >>> >> For SQL Server 2000 / ASP.NET 1.1 :>> >>>> >> http://samples.gotdotn et.com/quickstart/aspplus/>> >>>> >> For SQL Server 2005 / ASP.NET 2.0 :>> >>>> >>[/color]
                      http://asp.net/QuickStart/aspnet/doc/data/default.aspx>> >>>> >>>> >>>> >>>> >> Juan T. Llibre, asp.net MVP>> >> aspnetfaq.com : http://www.aspnetfaq.c om/>> >> asp.net faq : http://asp.net.do/faq/>> >> foros de asp.net, en español : http://asp.net.do/foros/>> >> =============== =============== =====>> >> "amjad" <amjad@discussi ons.microsoft.c om> wrote in message>> >> news:CF7D5B73-CE3A-42C4-ABCE-BBDB67352A2C@mi crosoft.com...> > >> > how to connection sql server table with aspx like pulling data from table to>> >> > grid view.... simple example to start ....>> >> > thanks>> >>>> >>>> >>>>>>>>[color=blue]
                      >
                      >[/color]

                      Comment

                      Working...