473,383 Members | 1,837 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

cant show data from my database

Hi

I have this code, but i can't get it to work, and if i delete <% %> then the if statsment is not working, how do i get this code to work.


Expand|Select|Wrap|Line Numbers
  1. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringMain %>"
  2.     SelectCommand="SELECT [SiteMainID], [SiteMainText] FROM [MainSiteText] WHERE ([SiteMainID] = @SiteMainID)">
  3. <%    Dim pageString As String = "Def"
  4.       If Not (Request.QueryString("Page") Is Nothing) Then
  5.         pageString = Request.QueryString("Page").ToString
  6.       End If
  7.       If pageString = "Def" Then
  8. %>
  9.         <SelectParameters>
  10.             <asp:Parameter DefaultValue="1" Name="SiteMainID" Type="Int32" />
  11.         </SelectParameters>
  12. <%
  13.       Else
  14.         If pageString = "Page1" Then
  15. %>
  16.         <SelectParameters>
  17.             <asp:Parameter DefaultValue="2" Name="SiteMainID" Type="Int32" />
  18.         </SelectParameters>
  19. <%
  20.         Else
  21.           If pageString = "Page2" Then
  22. %>
  23.         <SelectParameters>
  24.             <asp:Parameter DefaultValue="3" Name="SiteMainID" Type="Int32" />
  25.         </SelectParameters>
  26. <%
  27.  
  28.         End If
  29.       End If
  30. %>
  31. </asp:SqlDataSource>
  32.  
Jan 6 '07 #1
0 732

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: celtic_kiwi | last post by:
I have an Access 97 database, quite large, and have started getting the error, Error 3048: Can't Open any more databases. -The data is split from the application (front end and back end). -The...
7
by: Lian | last post by:
Hi every body I have a problem with accesses and visual studio. I've just installed XP and I can't get a connection with the Data base. I have this error and I don't know how to fix it The...
3
by: andrewcw | last post by:
I am trying to use the NorthWind database or anything with SQLEXPRESS on VS 2005 RC. I can see SQLExpress started with the tool SQL Server Configuration Manager. But when i select DataBase | New...
7
by: Mike Fellows | last post by:
Below is my code that is carried out on my dataset, datagrid etc... Im trying to get column0 "Date & Time" to show date and time, not just date ive read some stuff posted by Dmitriy Lapshin on...
16
by: Mike Fellows | last post by:
when i load my windows form i populate a combobox i use the code below Dim conn As New System.Data.SqlClient.SqlConnection(strConn) Dim sql As String = "AllLenders" Dim da As New...
5
by: plenahan68 | last post by:
I've made a small vb.net program to read my database and delete records that are specific to my needs. Well, the program says it's complete but nothing is deleted from my database. I've listed the...
4
by: cooltech77 | last post by:
Hi, I am trying to build the following functionality in the datagrid. I have a lot of columns in the datagrid which are being populated from the database and the user needs to scroll...
11
by: Don | last post by:
I have a WPF application in VB in VSTS 2008 RTM. I am trying to "blink" (momentarily clear) a field of data if the data is reloaded from the database to give the user some visual indication of the...
6
flexsingh
by: flexsingh | last post by:
Hello there, I have constructed a option of choosing a court only available when member no = "0". This works fine and is in the first code: - <html> <head> </head> <body background="main...
3
by: kkshansid | last post by:
i cant insert data from rich text box to my sqlserver database while all other data inserts using strDescription = trim(Request.Form("rte1")) if i use rte safe then error is shown and whole...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.