Forms Data Controls :: Add Data From Databases On The Description Tag?
Feb 28, 2011How to add data from databases on the description tag in ASP.Net(C#)(like Page.Tittle?)
View 2 RepliesHow to add data from databases on the description tag in ASP.Net(C#)(like Page.Tittle?)
View 2 RepliesI have almost got this all working but one thing. What i am doing is SELECTING a number of details from a table which is for job vacancies. I am then displaying the job_name, a short description about the job and finally the location's the job is available in..If you look on this page:http://kidsunlimited.co.uk/vacancies_test.aspx
You will see a list of Vacancies shown BY job name. The problem occurs when the job is available in more than once location. Take a look at the Cook vacancy. It should be reading as Cook, then the description and then location which in this case there are 2.But instead it mixes them up and displays one location before the description and one after..This is the code i have :
[Code]....
The problem is on this line i think:
[Code]....
i want the following in 1 div. say <div="topdiv">: i want to display on aspx page one image and its description fetched from database. i want to provide a next button at the side of it, onclick of this the next image and descriptn must be displayed without page being refreshed. i have another div (<div="divbottom"> which displays other information..
View 1 Replies<asp:FormView ID="FormView1" runat="server" DataKeyNames="productnum"
DataSourceID="EDS_Product">
<ItemTemplate>
<div class="ContentHead"><%# Eval("name") %></div><br />
<table border="0">
<tr><td style="vertical-align: top;">
<img src='images/big/<%# Eval("image") %>' border="0" alt='<%# Eval("name") %>' /></td>
<td style="vertical-align: top"><%# Eval("description") %>
<br /><br /><br /></td></tr></table>
<span class="price"><b>Your Price:</b> <%# Eval("price", "{0:c}")%><br /><span class="number"><b>Number:</b> <%# Eval("number") %>
</span><br /><a href='AddToCart.aspx?productnum=<%# Eval("productnum") %>'>
<span class="ProductListItem"><b>Add To Cart<b></font></span></a>
</ItemTemplate>
</asp:FormView
this is from the product details page and the description goes in a straight line always - i want to make the description a box and have lenght of 30 characters every line -- i want to modify the description not to be in a straight line
i have a enum class and i want get value and description from enum and bind to dropdownlist but i can get name from enum how do this ?
public enum UniqeGroupId{
[Description("x")]
Group = 1,
[Description("b")]
Run = 2,
[Description("c")]
shopping =3
}
I want to display modalpopup the description using datalist, yesterday i asked same question for image ...
View 1 RepliesI have two databases (DB1 & DB2) from which i wish to build a single table/gridview output, ideally i want to be able to sort the table by using any data.
However i cannot seem to figure out how to have more than one datasource per Gridview, and if i have more than one Gridviews then i can't sort all the data by any of the columns.
This is a oneway street, i do not want to update the databases from the webfront end.
Here is a Trimmed Down Version of what i have
[code]....
Trying to figure out how to handle data returned for a site search from a description field. I don't think I want to display all the text from the description field, but I also don't want to "chop" a word in half. How do I get the first 100 characters, plus a few extra letters if needed to prevent a word from being chopped in half. In some cases, the description field is less than 100 characters, so all the text will be displayed. However, if the description does need to be chopped at 100, I'd like to finish the word and add ... to indicate that there is more text.
View 6 Replies(coded in VB)i have Gridview which consists of textbox and dropdownlist. Now i want watever text is input in textbox and selected in dropdownlist, it should be inserted in my database..
i have code but it doesnt work...
to test it i have used label..to check whethher it shows selected information on button click...
but i want the selected or written value to be inserted in database on button click..
[Code]....
CODE IN BACK-
[Code]....
i want to develop a data access layer ,it can support multiple database like oracle ,Mssqlserver and Mysql using enterprise library and C#.net 3.5 based on database connection
View 1 RepliesI developed a web site more then a year ago with .net2.0/c#/mssql 2005. it works fine but i was asked to replace mssql with mysql.
I wrote a class to complete data access works (unfortunately, I didnt use nhibernate or other data access tools :((
I edited the class to use System.Data.Odbc objects rather than System.Data.SqlClient.
It works fine in selecting data but not manipulating data. when i try to insert new data it adds null data for all fields in the table.
in debug mode, i noticed that it might be caused by OdbcParameter but not sure.
I have in my database the News Table which consist of => Id, Title, txt . I need to be able to get a description text from the whole text which exist in txt Field , but without any codes like <...> , just a pure text !! how can I do this?
View 3 RepliesI want to transfer data from an acces database to a sqldatabase. This is my code:
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
#region page load
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion
protected void click_Transfer(object sender, EventArgs e)
{
OleDbConnection conn1 = null;
OleDbDataAdapter da1 = null;
DataSet ds1 = null;
SqlConnection conn2 = null;
SqlDataAdapter da2 = null;
DataSet ds2 = null;
// 1 Opzetten dataAdapter en dataset
try
{
// Ophalen connectiestring en opzetten v/d connectie
string connString1 = ConfigurationManager.ConnectionStrings["PrinterConnectionString"].ToString();
conn1 = new OleDbConnection(connString1);
string connString2 = ConfigurationManager.ConnectionStrings["PrinterConnectionString2"].ToString();
conn2 = new SqlConnection(connString2);
// Aanmaken van DataAdapters
da1 = new OleDbDataAdapter();
da2 = new SqlDataAdapter();
// Opzetten SelectieCommand
string sql1 = "SELECT * FROM tblPrinter";
OleDbCommand cmd1 = new OleDbCommand(sql1, conn1);
SqlCommand cmd2 = new SqlCommand(sql1, conn2);
da1.SelectCommand = cmd1;
da2.SelectCommand = cmd2;
string sql2 = @"INSERT INTO tblPrinter(PRINTER_ID, tblSoortApparaat, MERK, MODEL, LOKAAL_ID )" +
@"VALUES (@id, @soort, @merk, @model, @lokaal)";
cmd2 = new SqlCommand(sql2, conn2);
// InsertCommand dataAdapter
cmd2.Parameters.Add("@id", SqlDbType.Int, 0, "PRINTER_ID");
cmd2.Parameters.Add("@soort", SqlDbType.NVarChar, 100, "tblSoortApparaat");
cmd2.Parameters.Add("@merk", SqlDbType.NVarChar, 100, "MERK");
cmd2.Parameters.Add("@model", SqlDbType.NVarChar, 100, "MODEL");
cmd2.Parameters.Add("@lokaal", SqlDbType.Int, 0, "LOKAAL_ID");
da2.InsertCommand = cmd2;
ds1 = new DataSet();
da1.Fill(ds1, "PRINTERS");
ds2 = new DataSet();
da2.Fill(ds2, "PRINTERS2");
// Stap 2: Start bewerking!!
DataTable table1 = ds1.Tables["PRINTERS"];
DataTable table2 = ds2.Tables["PRINTERS2"];
DataRow newrow = null;
for (int i = 0; i < table1.Rows.Count; i++)
{
newrow = table2.NewRow();
newrow["PRINTER_ID"] = i + 1;
newrow["tblSoortApparaat"] = table1.Columns[1].;
newrow["MERK"] = table1.Columns[2].DefaultValue;
newrow["MODEL"] = table1.Columns[3].DefaultValue;
newrow["LOKAAL_ID"] = table1.Columns[4].DefaultValue;
table2.Rows.Add(newrow);
}
da2.Update(ds2, "PRINTERS2");
lblMessage.Text = table1.Rows.Count.ToString() + " rijen zijn toegevoegd";
// bindgrid();
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
}
Here is my problem newrow["tblSoortApparaat"] = table1.Columns[1].; When i do that al the rows in my sql database are filt up with the columname. But i want the specik data. For example sql database:
1 tblSoortApparaat
2 tblSoortApparaat
3 tblSoortApparaat
But what i want is
1 PRINTER
2 PC
3 PRINTER
Ours is a Asp.net web application. Database is Oracle. Its an Internet Application.
Database will be in one location and Web application in another. Data from Oracle to Web application will be passed over Internet.
We are using EnterpriseLibrary. And provider is System.Data.OracleClient.
We need a provider which encrypts the data while passing data over internet.
Do we need to go for some third party Providers or ODBC ?
I am fetching data from oracle data base in asp.net application. To achieve this functionality i have used Oracle.DataAccess dll . In my developement enviorment it working fine.
But once I deployed this code on IIS 6.0 it is stopped working and I checked my log and found connection not get established . Then I make sure Oracle.DataAccess.dll present in to bin folder also I try to put this dll in side GAC, but still my code is not working on deployed server.
i have the following two questions:-
1. let say i have a table for ITEMS including (item id,item description id (FK to the ITEM Description tabe), item price,etc) and have ITEM Description look up table having (item descriptionid,item description),.
so what is better to use the ITEM DESCRIPTION look up table and store the item description id in the items table
or
to directly store the item description "Not the id" in the item table.
2. I am working on an MVC web application using LINQ, now if i want to modify the SQL server tables which i have created for example modify some of the foreign key properties will the effect be directly reflected on any new inserted or deleted records or i have to create a new LINQ to SQL class?
SELECT *
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME =
'Description'
vw_aspnet_Applications Description
aspnet_Roles Description
vw_aspnet_Roles Description
aspnet_Applications Description
The above query returns only those columns that are named "Description" from the default asp.net membership tables. That is not what I want. Each column has a property called "Description" which allows the developer to provide a detailed description for each SQL field (a.k.a. "column"). Example: aspnet_Membership has a column "Password" which does not have anything in the "Description" property although it should have imo
because without a description, it is not obvious that the password's value happens to be encrypted.
Scenario: Assume that I have a table called Trucks that has data like
Number Odometer ... et cetera
It's schema looks something like this (abbreviated)
COLUMN_NAME Description
Number yyyynnnn where 'yyyy' is year truck was purchased, 'nnnn' is sequential number.
Odometer most recent odometer reading in kilometres
How would I code a SQL SELECT statement in SSMS 2008 to display the schema data such as a column's name, its description text, et cetera? because "description" is such a generic term, I've so far been unsuccesful at locating further information in Google.
i have a dropdownlist and i get the value from database and it's working good.. now i want to add description in the same drop down list..
View 5 RepliesI'm doing up a search engine & what i want to happen is to get the title and description from the page as in below:
[Code]....
And here is the code that gets the meta tags:
[Code]....
Just can't write the code to get the title & description to show on the search result page.
Where can I control right url address when the page is routed, using new routing feature in asp.net 4?
I tried to catch wrong url in the OnPreinit(), but the error is already thrown.
Error: The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. review the following URL and make sure that it is spelled correctly.
i could not able to include the meta tag for description and keyword, set to unique on all the pages.
View 1 Repliesi have seen your article to display value in title and keyword tag from database. then i want to know to display value in META Description tag from database .
View 1 RepliesI want to include meta tag keyword and meta tag description of my website from database for each products in masterpage of my asp.net website.
View 1 RepliesI just encountered in this buzzard problem. I have a site that working long time now.Today I was surfing in my site when I just saw that some line that build from the DB data was missing.I started to investigate my code to see where te problem is. I did not find it.So I refreshed the page and there it was, the missing line.I kept refreshing the page and I saw that sometimes some data not retrieved from the db. Now sometimes its page info data and sometimes its data that determine if the page will load or trough page exception / page load error.So, HOW CAN IT BE? how sometimes a query will return data and sometimes it doesnt?the site uses mysql-connector-net-6.2.2
View 6 Replieshave a sp in oracle which has 3 input parameters and 3 output parameters( 1 ref cursor, i number, 1 varchar2)
Command.CommandText = sp name;
Command.CommandType =
CommandType.StoredProcedure;
i am doing cmd.ExecuteNonQuery();I am able to get the number and varchar2 values from output parameters. But i am unable to get output from Ref Cursor. (How can i get this...)If i use dataadaptor then i am getting the datatable in the dataset(but i am not getting the other two parameters(where will get the other two??)...