Display Data Without Binding
May 26, 2006
Hi All
I am new to VS 2005 and ASP.NET. I used to use Dreamweaver to design but now I am trying VS.
What I want to do is to display data retrieved with a SqlDataSource in a web page. I know how to do it by binding it to the various controls (Grid, DataList, DetailsView, FormView, Repeater.) available but how can I display it without using any of the mentioned (Grid, DataList, DetailsView, FormView, Repeater)?
Any help apprecited.
View 1 Replies
ADVERTISEMENT
Jun 3, 2008
Hi guys, I am about to bind my websites user inputted values into my database. I intend to use sql for this. THe site is very basic, dropdownlists and textboxes. The user is required to choose values and write in questions. Now these inputs ought to be stored somewhere right??, so for that i am using sql. Now i know sql, but how do I store data from a website and all, I have no clue, someone give me basic steps on how to go about doing this pleaseeeeee!!!
View 2 Replies
View Related
Apr 30, 2015
I would like to display a portion of report where there is data or no data
There is data subreport  display  Â
   Product Name Latex Gloves Â
   Product ID   Â
xxxx5678
 There NO data in the subReport
Â
  Product Name             Â
  Product ID  Â
View 3 Replies
View Related
Apr 15, 2007
I want to bind some data to a text box from sql server db. but when i run the page i get an error. here is my code.
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:imacsConn %>"
SelectCommand="SELECT Reportnumber FROM [SummaryBlue] WHERE REPORTNUMBER = @REPORTNUMBER">
<SelectParameters>
<asp:QueryStringParameter Name="REPORTNUMBER" QueryStringField="REPORTNo" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox1" runat="server" Columns="<%$ ConnectionStrings:imacsConn %>"></asp:TextBox></div>
</form>
Error:
Exception Details: System.FormatException: Input string was not in a correct format.Source Error:
Line 25: </SelectParameters>
Line 26: </asp:SqlDataSource>
Line 27: <asp:TextBox ID="TextBox1" runat="server" Columns="<%$ ConnectionStrings:imacsConn %>"></asp:TextBox></div>
Line 28: </form>
View 2 Replies
View Related
May 17, 2007
Hi i'm a new to ASP.NET and for some reason when i click the Next button in the code below, the pageIndex does not change. Please assist, Basically what i'm trying to do is to use DataAdapter.fill but passing in the start index and the number of records to pull from the dataset table.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class Home : System.Web.UI.Page
{
//ConnectionOleDbConnection dbConn;
//discount that can be change by user using a gui interface
//CurrentPageint pageIndex = 0;double discount = 0.15 ;
protected void Page_Load(object sender, EventArgs e)
{
// homeGridView.Visible = true;
BindList();
}protected string getSpecial(string price,object sale)
{String special = "";if (sale.ToString().CompareTo("True") == 0)
{special = String.Format("{0:C}",double.Parse(price) * (1-discount));
}return special;
}
protected void BindList()
{
//Creating an object for the 'PagedDataSource' for holding the data.
//PagedDataSource objPage = new PagedDataSource();
try
{
//open connection
openConnection();
//sql commandstring columns = "*";
string SqlCommand = "Select " + columns + " from Books";
//create adapters and DataSetOleDbDataAdapter myAdapter = new OleDbDataAdapter(SqlCommand, dbConn);DataSet ds = new DataSet("bSet");
//create tableDataTable dt = new DataTable("Books");myAdapter.Fill(ds, pageIndex, 9, "Books");
Response.Write("Page Index: "+pageIndex);
//create table data viewDataView dv = new DataView(ds.Tables["bTable"]);
booksDataList.DataSource = ds;
booksDataList.DataBind();
myAdapter.Dispose();
dbConn.Close();
}catch (Exception ex)
{
Response.Write("Exception thrown in BindList()");
dbConn.Close();throw ex;
}
}
public void openConnection()
{string provider="Microsoft.Jet.OLEDB.4.0";
string dataSource = "C:/Documents and Settings/Owner/My Documents/Visual Studio 2005/WebSites/E-BookOnline/App_Data/BooksDB.mdb";dbConn = new OleDbConnection("Provider =" + provider + ";" + "Data Source =" + dataSource);
dbConn.Open();
}protected void nextClick(object sender, EventArgs e)
{
pageIndex=pageIndex+1;Response.Write("In nextClick"+pageIndex);
BindList();
}protected void prevClick(object sender, EventArgs e)
{if (pageIndex > 0)
{
pageIndex=pageIndex-1;
BindList();
}
}
}
View 1 Replies
View Related
Jun 30, 2007
hi,i have a DB that contains some tables.so i have a radio button group of tow radio button to display a field.now how can i bind this radio button group to this field for updating and insert a new record?for more explain i brought a little of code below: in .aspx page i have: <asp:RadioButton ID="admin" runat="server" Checked="True" GroupName="membertype"
Text="admin" OnCheckedChanged="admin_CheckedChanged" /><br />
<asp:RadioButton ID="member" runat="server" GroupName="membertype" Text="member" /> -------------------------------------------------------------------------- <asp:ControlParameter ControlID="membertype" Name="isadmin" Type="string" PropertyName="text" />-------------------------------------------------------------------------- UpdateCommand="UPDATE UserManagement SET UserName = @UserName, Password = @Password, FullName = @FullName, Description = @Description, UserID = @UserID ,isadmin=@isadmin,usercitycode=@location WHERE (UserID = @Original_UserID)" note that the type of the "isadmin" field is "nvarchar(50)"thanks,M.H.H
View 2 Replies
View Related
Mar 31, 2004
I have a block of code that does a Fill() with a DataAdapter, which seems to throw an exception if no values are returned. Then, when I try to bind the DataSet that gets filled, an error occurs, it doesn't even try to bind the column headers or anything.
This process seems to work fine when some rows are found, but it is not always guaranteed that the row count will always be > 0. The nice thing about using the Fill() function, is that it creates all my column headers automatically, so I was just wondering if there's a way to do a Fill() then a subsequent DataBind() to a DataGrid which would automatically format the columns even when no rows are found?
Here's a bit of the source.. if the last line finds no rows, it throws an exception ( I assume this is normal):
strSQL = "SELECT * FROM Prods";
cm.CommandText = strSQL;
da = new SqlDataAdapter( cm );
da.Fill(shelf);
Anyone got any ideas on how to fix this problem?
Brent
View 3 Replies
View Related
Jun 5, 2007
Hi there,
I'm trying to set an int type attribute to 0 for its Default Value, but it keeps reverting to ((0)). What is causing this?
Every int type attribute on that table does the same. There is one bit type attribute and a bunch of other type of attributes, but non of them are giving me a problem. The table is a copy from another database and I did check all the constraints and properties to make sure they're the same.
Thank you,
--Alex
View 1 Replies
View Related
Dec 14, 2007
Hi All,
I have written a Query and Stored Procedure in SQL 2000 which fetched around 15 Lac data. It takes around 17 seconds to fetch the data in the Query Analyzer. But when i am using the Query/Stored Procedure in the report and I have deployed it in the server. When i am accessing the report in the application it taking around 2-3 minutes to bind the data.
What might be the issue? My tables in the database has been normalized.
Please help me to sort out this problem.
Regards
View 15 Replies
View Related
Dec 10, 2007
Hi,
Referring to the book "Data Mining with SQL Server 2005" written by ZhaoHui Tang, I created a Mining Structure and a Mining Model with the AMO API after creating Database and Data Access Objects(referred to code lists from 14-1 to 14-6). I added Nested Table by creating a table column and added a key column to the nested table, while the error showed that in my structure the column of the nested table didn't include effective data bindings when processing.
Thanks for any suggestion!
View 3 Replies
View Related
Mar 6, 2007
Hi there everyone. I have a stored procedure called “PagingTable� that I use for performing searches and specifying how many results to show per ‘page’ and which page I want to see. This allows me to do my paging on the server-side (the database tier) and only the results that actually get shown on the webpage fly across from my database server to my web server. The code might look something like this:
strSQL = "EXECUTE PagingTable " & _
"@ItemsPerPage = 10, " & _
"@CurrentPage = " & CStr(intCurrentPage) & ", " & _
"@TableName = 'Products', " & _
"@UniqueColumn = 'ItemNumber', " & _
"@Columns = 'ItemNumber, Description, ListPrice, QtyOnHand', " & _
"@WhereClause = '" & strSQLWhere & "'"
The problem is the stored procedure actually returns two result sets. The first result set contains information regarding the total number of results founds, the number of pages and the current page. The second result set contains the data to be shown (the columns specified). In ‘classic’ ASP I did this like this.
'Open the recordset
rsItems.Open strSQL, conn, 0, 1
'Get the values required for drawing the paging table
intCurrentPage = rsItems.Fields("CurrentPage").Value
intTotalPages = rsItems.Fields("TotalPages").Value
intTotalRows = rsItems.Fields("TotalRows").Value
'Advance to the next recordset
Set rsItems = rsItems.NextRecordset
I am trying to do this now in ASP.NET 2.0 using the datasource control and the repeater control. Any idea how I can accomplish two things:
A) Bind the repeater control to the second resultset
B) Build a “pager� of some sort using the values from the first resultset
View 3 Replies
View Related
Apr 1, 2015
when i do a snapshot i have it set up to truncate before inserting. As a result I'm getting an error saying that it cant truncate a table reference in an indexed view. What settings should i use to allow for a snapshot in this instance? Should i manually drop the databinding then snap then recreate the databinding? there has to be a better way
View 1 Replies
View Related
Jul 9, 2007
I am trying to display hirearchical data using data region. For eg. the first level will be a list of customer names. The second level will be a list of Invoices under each customer. The third level will be a list of product names that were sold under each invoice.
I used a list for the data region and in each hireachy, there is a textbox in each list to display the data. I am trying to associate each data region with a datatable (I will provide the logic to populate the datatable with appropiate data). I do not want the ReportViewer to interact directly with a database because this is a 3 tier design and I am using the ReportViewer in local mode. I couldn't find any example of these. Can anybody help? Also I would like to see an example of the .rdlc file in these situation. Thanks very much.
Kam
View 4 Replies
View Related
Oct 10, 2006
I've always bound data to a dataset...how do I display data without a dataSet? This is how i usually display data... SqlConnection myConnection = new SqlConnection(conn); string sqlQuery = "SELECT * FROM questions"; SqlDataAdapter myCommand = new SqlDataAdapter(sqlQuery, myConnection); DataSet ds = new DataSet(); myCommand.Fill(ds, "questions"); MyDataGrid.DataSource = ds.Tables["questions"].DefaultView; MyDataGrid.DataBind(); <%# DataBinder.Eval(Container.DataItem, "answer3")%>
View 1 Replies
View Related
Apr 2, 2001
Hi,
I have stored procedure with cursor
I have to use following
step 1 fetch RateValidDates into @Id_RateCode, @TheValidDate
.... get data
step 2 fetch prior from RateValidDates
... condition
step 3 fetch NEXT FROM RateValidDates into @Id_RateCode, @TheValidDate
... go to next record
Sql query analyzer output result of fetch NEXT FROM on the screen
What seeting should i use to avoid output on screen
(The reason My cursor takes about 8000 - 10000 rows when it's open)
View 1 Replies
View Related
Dec 22, 1999
When I select a table and try to view the data I take the return all rows or return top option. However nothing is displayed. These options worked before and I don't understand why it's not working now. Can anyone help?
View 1 Replies
View Related
Jan 28, 2015
I want to output this result. how to write this query? "This is new amount 1000" select "This is new amount "+@sum(amt) as amount from table
View 2 Replies
View Related
Sep 28, 2005
I have a db; that stores a company name; if the end user types in
The Stoneware Jar Company
I would like to display:
Stoneware Jar Company
All company names entered like that with no preceding "The"
How can I display something diff on my ASP Page? Possible?
View 20 Replies
View Related
Jun 6, 2006
I have data in rows that I need to aggregate and display in a columnar fashion and I haven't been able to figure out how to do it. A simplified version of the data as it is stored in the table:
Station Month Day Reading
1 1 1 100
1 1 2 200
1 1 3 300
1 2 1 400
1 2 2 500
And I would like to create a query that returns:
Station Month Day 1 Day 2 Day 3
1 1 100 200 300
1 2 400 500
Any help you can provide or tips to steer me in the right direction are much appreciated.
Dianne Siebold
View 6 Replies
View Related
Apr 4, 2007
Hi,
I have a result set from a store procedure which looks like this.
Column1 Column2 Column3
A 1 lit1
A 1 Rep2
A 1 Reg3
B 2 ram1
B 2 lim2
I want to show data in my table like this:
Column1 Column2 Column3
A 1 lit1; Rep2;Reg3
B 2 ram1;lim2
Can anyone tell me how I can do this?
Thanks
Ashwini
View 1 Replies
View Related
Oct 30, 2007
I am using a filter in a matrix control. I would like to display a "No data" type message if no data is present. The problem I'm running into is the base query is returning data, but the optional filter is removing all rows from display.
So using CountRows in the base dataset doesn't quite cut it. Is there an alternative?
View 4 Replies
View Related
May 6, 2007
Hello,
I have matrix object in reportin (SQL 2005 reporting services)
When in some field have no data it display NaN.
How can I change it ?
I try to use iif(my function = nothing.....) but didn't help
View 1 Replies
View Related
Jan 6, 2008
I have a fairly complicated report consisting of numerous datasets and numerous tables.
In one of my tables I want to display the message "No data to display" if nothing comes back from the query. Currrently the table just disappears if there is no data. Is there a way to display the table if there is nothing in the query?
View 4 Replies
View Related
Mar 5, 2006
Hi all. i have the following function below,which use to retrieve the order detail from 2 table which are order detail and product. i have many duplicated order id in order detail, and each order id has a unique product id which link to product to display the product information. however when i run the following function below . its duplicated each product info and dsplay in the combo box. May i know whats wrong with my code?
Public Sub ProductShow()
Dim myReader As SqlCeDataReader
Dim mySqlCommand As SqlCeCommand
Dim myCommandBehavior As New CommandBehavior
Try
connLocal.Open()
mySqlCommand = New SqlCeCommand
mySqlCommand = connLocal.CreateCommand
mySqlCommand.CommandText = "SELECT * FROM Product P,orders O,orderdetail OD WHERE OD.O_Id='" & [Global].O_Id & "' AND P.P_Id=OD.P_Id "
myCommandBehavior = CommandBehavior.CloseConnection
myReader = mySqlCommand.ExecuteReader(myCommandBehavior)
While (myReader.Read())
cboProductPurchased.Items.Add(myReader("P_Name").ToString())
End While
myReader.Close()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
connLocal.Close()
End Try
End Sub
View 1 Replies
View Related
Jul 23, 2007
I have the following sqlDataSource. I wan't to display one piece of data, not a whole row, from it. I can find lots of information on putting it into a datagrid, but nothing on puttin one piece in a textbox. I cannot use a formview as we are embedding html in response.write and it breaks in a formview. Thanks.
<asp:SqlDataSource runat="server"
ID="myEmpInfo"
SelectCommand="Select di.EmpInfo,di.eth,gc.t_level From tblEmp di
,tblMisc gc
Where di.empnum = @empnumand di.empnum = gc.empnum" DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings : myConnectionString %>">
<SelectParameters>
<asp:QueryStringParameter Name="empnum" QueryStringField="empnum"/>
</SelectParameters>
</asp:SqlDataSource>
View 1 Replies
View Related
Dec 12, 2007
Hi,
I have a requirement where I need to display the items category wise
I have 3 tables,
one stores category_id, parent_id and category_name
second table stored item_id,item_name and proce
3rd table stores category_id and item_id
I need to display the values like this
Category name, Item name
with first parent category ans ites items should be displayed and next sub category and its item
By category table with contain 2 levels of sub category
i.e Category1
Category11
Category111
any help with the query would be much appreciated, I wrote the query something like this....
select c.category_name,parent_id,item_name from category c,items i,Category_item ci where
ci.item_id=i.item_id and c.category_id=ci.category_id order by parent_id, category_nameBut it will display all parent category items then the sub category items I want to display like thiscategory1 items1category11 item11category1 item12category11 item111category11 item112 category2 item2
Thanks
View 2 Replies
View Related
Mar 19, 2008
I have a webform that I am wanting to display data from a database. Right now I am using the gridview but for future purposes when it comes to maintenance what would be the easiest way to do updates? For example, if I add a new record into the database I would like the webform to automatically update itself to show all the records including the new record I added. Do I need to use a "table" and somehow connect it to a database? Do any stored procedures need to be created? Suggestions/ideas/codes help help help would be verrrry much appreciated!!! Also I am using MS Server 2003 and C# as the programming language. Thank you!!!!
View 9 Replies
View Related
Mar 28, 2008
I have a tabe in my sql server 2005 database which contains a long description and I want to display the first 100 charactors on my web page but not sure how to do this I can only display the whole description. I'm not sure if I need to write the query to the database so it only brings the first 100 charactors back or query the whole description and then take the first 100 charactors in asp.net and display that can any one help
View 3 Replies
View Related
Apr 25, 2008
Good Day, Please help me, I have a database that looks like this, Building No. Floor No. Room No. Customer Name Appliances Appliances Codea 1 01 John TV 12a 1 02 //up tob 20 10 james Ref. 22b 20 10 joe Microwave 15 //and soon so if you would notice some rooms are vacant, as it usually happens, the buildings, floors and rooms are fixed except for the customers and the appliances. so at first i made this gridview and display this data in this manner:Customer Location (Building + floor) total rooms Used Rooms Available rooms A1 2 1 1 B2010 2 2 0 so if you would look at the table above, it just SUM up all tenants in a specific Location then Group it by Customer location,but i need to add the appliances in a different format like this: Customer Location (Building + floor) total rooms Used Rooms Available rooms TV Ref Microwave
A1
2 1 1 tick
B2010
2 2 0 tick tick so this is what i need to show, i already have done the first table (w'o appliances) but how can i make this second table?? please help me, SALAMAT PO.,Thanks
View 3 Replies
View Related
Dec 5, 2006
Hi!
I have data in the following manner:
period course1 course2
4 NULL Eng
4 NULL Math
4 Phys NULL
4 Chem NULL
Is there any way I can show this data this way (the order is irrelevant - row1 can be joined with row3 or row4)?
period course1 course2
4 Phys Eng
4 Chem Math
4 Phys Eng
4 Chem Math
Basically, I want to be able to remove nulls.
Please let me know if any of you have come across such an issue.
Thanks so much!
-Parul
View 3 Replies
View Related
Oct 21, 2014
I have a table. I have some sensitive data that I don't want to display that sensitive data. The columns I want to abstract are
Firstname varchar(50) not null
Latname varchar(50) not null
dob datetime not null
addressline1 varchar(50) null
adressline2 varchar(50) null
city varchar(50) null
postalcode varchar(20) null
I want to display null values as nulls empty as empty not null as numbers.
View 4 Replies
View Related
Oct 2, 2007
Hi there
Assuming this is the query used to return this result:
select dept.name, count(prj.id) from department dept, project prj where prj.id = dept.uid group by dept.name
Dept, TotalProj
A , 10
B , 5
C , 2
Question: How do I change the query so that the result will return as follows:
Dept/TotalProj
A, B, C
10, 5, 2
View 5 Replies
View Related
Mar 14, 2008
I have a table with only one column as
Emp_Name
A
B
C
D
E
I want to display this data as
Emp_Name
A, B, C, D, E
Is this possible? I am using SQL server 2005.
Any help is appreciated.
Regards,
Vinesh
View 2 Replies
View Related