|
Hi
I am using Visual Studio with C# to develope a Web Application. I am using a DataList and binds it to a DataTable. When I run the application and the relevant page loads, the DataList is not displayed. I am using the following code:
private void Page_Load(object sender, System.EventArgs e)
{
string tableName = "Categories";
DataSet ds = categoriesDB.LoadCategories(tableName);
DataList_Categories.DataSource = ds.Tables[tableName];
DataList_Categories.DataBind();
}
The DataSet is holding data because when I bind it to a DataGrid on the same page to test it, the DataGrid displays the data correctly. What am I doing incorrectly or incompletely?
Thanks
Kobus
-- modified at 8:59 Thursday 11th May, 2006
|
|
|
|
|
Hi there. What does the ASP.NET markup of the datalist control look like? Also, you might want to check the Visible property of the control.
|
|
|
|
|
hi minhpc_bk
Thanks. I checked ASP.NET markup and I did not set up the ItemTemplate properly. It displays fine now. I am just struggling to get info out of the DataListItem when I have selected an item in the DataList.
|
|
|
|
|
DepLast = Convert.ToInt32(dt.Compute("SUM(essencbd_amount)","doc_date < '"+DateFormat.strYYYY+"/"+MM+"%' AND totalcode = '"+dsD.Tables[0].Rows[i][0]+"' ")) ;
i write this code but it give a error for this part"totalcode = '"+dsD.Tables[0].Rows[i][0]+"' ")) "
and that error massage is :
Cannot perform '=' operation on System.Decimal and System.String.
|
|
|
|
|
i am not sure but you can check it. normally the below statement returns a string and i think you are trying to add the returned string value to totalcode(probably a decimal).
dsD.Tables[0].Rows[i][0]
so you better to convert the same to decimal as shown below.
Convert.ToDecimal(dsD.Tables[0].Rows[i][0].ToString());
cheers.
Ramesh.Kanjinghat
|
|
|
|
|
You have to show the relevant code.
The = operator is not used in the code that you are showing, it's inside a string. The string is then fed to the dt.Compute method, so either you have to explain what that method does, or show the code for it.
---
b { font-weight: normal; }
|
|
|
|
|
ptvce wrote: DepLast = Convert.ToInt32(dt.Compute("SUM(essencbd_amount)","doc_date < '"+DateFormat.strYYYY+"/"+MM+"%' AND totalcode = '"+dsD.Tables[0].Rows[i][0]+"' ")) ;
This is horrible code. Consider refactoring it over several lines, that way you'll see the error more clearly and the compiler will be more helpful to you.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hello !
I'm in the network, and i done a web application that can be viewed on the network.
The questions that i need to know the IP of each computer on the network use my application, and after i store IP in listbox wherever.
Can someone give me help?
and thanks in advance.
Assaf
-- modified at 9:12 Thursday 11th May, 2006
|
|
|
|
|
|
how to transfer data from excel file to sql server's tables in asp.net programatically
i can't use wizard
can any body will help me regarding the same
thanks in advance
|
|
|
|
|
Hi,
It is big procee
Let give you hint
Use the OleDbProvider and open the file and file in to data set and update to database
ExcelConnectionString = Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties="Excel 8.0;HDR=YES";Data Source = " & ExcelFilePath
strSQL = "select Col1,Col2 from [Sheet1$]"
SomeDataAdapter = New OleDbDataAdapter(strSQL, ExcelConnectionString )
have SomeDataSet declared
daCollateral.Fill(SomeDataSet, <tablename>)
try this
Chinna Srihari
Tech Lead, Capgemini
|
|
|
|
|
thanks for the help,
that i did but it shows more than 4000 records while my excel file contains only 500
and the problem is that how i will transfer the same into sql tables
|
|
|
|
|
Hey...
Know of a good banner management for asp.net?
I was hoping to change from the 1 had used in all my previous projects...
-- modified at 7:30 Thursday 11th May, 2006
|
|
|
|
|
Hi,
I designed a menu with macromedia dreamweaver.It created a javascript and a file like *.js by it self.
I wanted to use this menu in my asp.net project therefore i copied the html codes and files from macromedia and pasted into my project.
When i run my asp.net project i can see the menu but the menu is not working properly.
It's colors must change when the mouse is on but not work.
How can i use macromedia projects in asp.net.
I want to include the macromedia codes in my project like this:
"<!--#include FILE="sol1.htm"-->"
how can i do it?
Thanks.
|
|
|
|
|
Are you sure you maintained the relative paths between the files correctly?
|
|
|
|
|
how to transfer data from a excel file into sql server's table.
Thanks in advance
|
|
|
|
|
first you must select a database and tables from enterprise manager which you want to insert excel table into.
then click the right button of the mouse and select import data.
The menu steps show you how to solve this problem.
|
|
|
|
|
but i can't use enterprise manager
i have to do that programatically in my asp.net application.
|
|
|
|
|
|
If more than 25 users are accessing the same web server at a time.Suddenly some one's session got expired (But session time is 20 minutes and also their pages are active ,working on that).How can we avoid this problem. Is there any settting in machine.config for this?
|
|
|
|
|
hello all,
can anyone suggest an answer for refreshing a mobile web form (every 2 sec)
Thanks,
jeeva
|
|
|
|
|
|
thanks for the link
jeeva
|
|
|
|
|
Sir,
I am displaying pictures in datalist and have fixed the width and height of image control in datalist.Now the problem is in the type of pictures i.e landscape and portrait The datalist containing the image control is not differentiating b/w the landscape and portrait pictures.I want to show the difference in landscape and portrait pictures in the image control in datalist.Can somebody please send me any link.
Thanks
|
|
|
|
|
Hi,
This will help.
http://www.15seconds.com/issue/020102.htm
Hope this will help you.
Best Regards,
Apurva Kaushal
|
|
|
|