Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1108065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:01:33+00:00 2026-05-17T02:01:33+00:00

I downloaded some sample code which includes a database query within the markup code.

  • 0

I downloaded some sample code which includes a database query within the markup code. It makes a query to the database and displays the results of the web form and I would like to divert the output to a text file and I am not sure how to do this?
Can this be done from here or would it just be easier to code it in the source and make a new connection to the database?

Sample code:

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringIP %>"
        DeleteCommand="DELETE FROM [ip-to-country] WHERE [ID] = ?" InsertCommand="INSERT INTO [ip-to-country] ([ID], [BeginingIP], [EndingIP], [TwoCountryCode], [ThreeCountryCode], [CountryName]) VALUES (?, ?, ?, ?, ?, ?)"
        ProviderName="<%$ ConnectionStrings:ConnectionStringIP.ProviderName %>" SelectCommand="SELECT * FROM [ip-to-country] WHERE (([BeginingIP] &lt;= ?) AND ([EndingIP] &gt;= ?))"
        UpdateCommand="UPDATE [ip-to-country] SET [BeginingIP] = ?, [EndingIP] = ?, [TwoCountryCode] = ?, [ThreeCountryCode] = ?, [CountryName] = ? WHERE [ID] = ?">

        <SelectParameters>
            <asp:ControlParameter ControlID="txtIPNumber" DefaultValue="" Name="BeginingIP" PropertyName="Text"
                Type="Double" />
            <asp:ControlParameter ControlID="txtIPNumber" DefaultValue="" Name="EndingIP" PropertyName="Text"
                Type="Double" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="BeginingIP" Type="Double" />
            <asp:Parameter Name="EndingIP" Type="Double" />
            <asp:Parameter Name="TwoCountryCode" Type="String" />
            <asp:Parameter Name="ThreeCountryCode" Type="String" />
            <asp:Parameter Name="CountryName" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="BeginingIP" Type="Double" />
            <asp:Parameter Name="EndingIP" Type="Double" />
            <asp:Parameter Name="TwoCountryCode" Type="String" />
            <asp:Parameter Name="ThreeCountryCode" Type="String" />
            <asp:Parameter Name="CountryName" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <br />
    IP Address :
    <asp:TextBox ID="txtIPAddress" runat="server" Wrap="False"></asp:TextBox>
    <br />
    IP Number :
    <asp:TextBox ID="txtIPNumber" runat="server" AutoPostBack="True" ReadOnly="True"
        Wrap="False"></asp:TextBox>
    <br />
    <br />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:01:33+00:00Added an answer on May 17, 2026 at 2:01 am

    You would be better off doing this in the code behind, do the database call to a dataset or entities etc, do whatever it is you want to do with the data and then use the same data objects as the source for a datagrid or repeater, or however you wish to display this data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have downloaded an sample code, so there are some CString variables in that
I wrote an app in C++, and downloaded some samples code from the internet
im trying to extract some files from a jar-file downloaded using java-webstart. below code
I was going through some code that I downloaded off the internet ( Got
Apple just released some sample code on lazy loading images in a UITableView a
I have a simple question which is giving me some difficulty. I have downloaded
Here's some sample code that I want to control using jQuery (white button bg
My Eclipse is downloaded some days ago from http://www.eclipse.org/downloads/ and the type is Eclipse
I have downloaded some files from the internet related to a particular topic. Now
I have some demos that I downloaded and they come with a Makefile.win and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.