|
Hi There,
I had taken 31 column in grid view.But when I take 32 column and run the project then it throws an exception as index out of rage.Can any one tell me how many column allowed in grid view.
Thanks.
|
|
|
|
|
I am sure that 32 columns would be fine.
Perhaps if you posted the code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
protected void gvDispatch_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex == -1)
{
if (ddlType.SelectedValue == "D")
{
for (int i = 1; i < 32; i++)
{
gvDispatch.Columns[i].HeaderText = i.ToString();
}
}
}
}
public void fillGrid(GridView gv, string type)
{
DataSet ds = new DataSet();
string qry = "";
qry = "select OADET_ID,Item_descriptioin from MAS_ITEMMASTER,MAS_SALES_ORDER_DETAIL WHERE OADET_ITEM_ID=ITEM_ID and OADET_CM_COMP_ID=1 and OADET_BM_ID=1 and OADET_DELETE=0";
ds = CommonClass.objcon.GetDS(qry); //GetDS is my Common Class Method
gv.DataSource = ds;
gv.DataBind();
}
Exception:-
Index was out of rage.Must be non-negative and less than the size of collection.Parameter name index.
|
|
|
|
|
ais07 wrote: f (ddlType.SelectedValue == "D")
{
for (int i = 1; i < 32; i++)
{
gvDispatch.Columns[i].HeaderText = i.ToString();
}
}
}
}
So you don't have that many columns, and it blows up. Use gvDispatch.Columns.Length ( or Count, whatever it is ) instead of hard coding what is apparently a false assumtpion.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI all,
I have a datagrid with one field link buttons(in this field some paths are there).When i am clicking that field ,i want to get the path
Thanks in advance!!!
|
|
|
|
|
If the path is there, then you have it, right ? Or, what do you mean ? I would imagine you want to get an id and look up the path, or store the path against the item.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Actually my requirement is ,i have a customized media player,and when i am clicking the field,i want to get the path in a string ,then i can give it to the player to play
|
|
|
|
|
OK, so where does this path come from ? Where do you have it stored now ? How do you think you might access it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI,
The path is comming from database,suppose if i have the a file in C: in a folder New and the file name is abc.wav ,when i am clicking the field i want to get the full path like C:\New\abc.wav . (i want this to a string)
Thanks!!!!
|
|
|
|
|
So, this file exists on your server file system ? Your most likely course is to use a command button and make the path your command argument.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hai Christian Graus,
Thanks
|
|
|
|
|
I made a media player a while back because I HATE iTunes and Zune software. What I did what make a column in the DataGrid store the path, and then simply didn't display that column to the user.
Would that be a possibility?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hai,
Thats fine,but i want to give the file names to the user to choose the file to play,All that are audio files,so user cant select their own files ,cant maximize ,all they can do is play the files listed in the gridview.And finally i got the solution and now it is working fine,again thanks for the ideas.
|
|
|
|
|
i m working in ASP.net with VB.In my project i have enter the content of a file into the BLOB type field of an oracle table.How can it be possible.It will be a document back up system,where all content of a file will be transfered to a table.So how can i fetch the content of the doc or ppt,pdf type file and transfer it to the oracle table.
If you have any article then plz mention.
Thanx in advance.
Sourav
|
|
|
|
|
Hello All,
I would just like to get some advice (ie not solutions) about how I may be able to learn about making web mashups for my college project.
At this moment in time I have learnt about basic XML, how to a basic webservice and consuming a web service.
For example I have looked at Amazon web services and gone through the example of how to search for their catalogue on my own website and bringing up results.
However I would like to do something slightly more complex than that, but I find that their references are really difficult to understand.
Can someone outline the key concepts for me to achieve this and what resources that provide a more simpler outline , i can use to improve my understand how to make mashups.
Best Regards and Many Thanks
|
|
|
|
|
I guess you intend on consuming a number of web services and then showing the data from those services in your page ? I would imagine then what you need to do, is define the webservices you want to get data from, then look at the format of their data. A collection of nodes, as you'd get by taking a piece of XML, putting it in an XMLDocument and calling SelectNodes on it with some XPath, is a valid data source for a control such as a grid view or data grid, so I'd imagine you could get a list of items, show it and have pages you link to that show the details of a specific item.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello Christian,
That is correct...I am consuming a number of web services and showing it all in one project.
At the moment I am experimenting with the Flickr API, and i can wire the web service up to my application, authenticate it , that is fine. However in this one instance I have the urls of the flickr results defined by a search engine.
For example i type in "food" in the textbox and click search and the urls come up.
My problem i guess is trying to wire up the urls into a datalist/repeater so that I can display the images. I have thought of creating an xml file each time a search is generated so that the urls can be stored , which in turn can be used as the datasource by the repeater. Is there a better way of doing this? Many thanks for your response.
Best Regards
|
|
|
|
|
Hi
I am new to ASP and have the following code on my html page. It is basically an invitation to a google group. You type in your email and then hit subscribe. How do I port this to asp?
<table align="center" border="0" cellspacing="0" style="padding-right: 5px; padding-left: 5px;
padding-bottom: 5px; padding-top: 5px; background-color: #fff; color: #000000;">
<tr>
<td>
<img alt="Google Groups" height="26" src="http://groups.google.com/groups/img/3nb/groups_bar.gif"
width="132" />
</td>
</tr>
<tr>
<td style="padding-left: 5px">
<b>Subscribe to OkaloosaRugby</b>
</td>
</tr>
<form action="http://groups.google.com/group/okaloosarugby/boxsubscribe">
<tr>
<td style="padding-left: 5px">
Email:
<input name="email" type="text" />
<input name="sub" type="submit" value="Subscribe" />
</td>
</tr>
</form>
<tr>
<td align="right">
<a href="http://groups.google.com/group/okaloosarugby">Visit this group</a>
</td>
</tr>
</table>
|
|
|
|
|
Are you doing ASP, or ASP.NET ? They are different.
You can just type this in directly, the form will submit with the info just as you want it. ASP.NET just emits HTML, if you want to use HTML directly, you always can, there's actually nothing else your browser understands.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I can't figure out why I'm getting this error, any ideas? I also get 'Virtual Directory does not allow content to be listed' until I restart VS2008 SP1.
Has anyone encountered similar issues?
Error:
Cannot find ContentPlaceHolder 'ContentPlaceHolder1' in the master page '/TestWebSite/WroxMozilla.master', verify content control's ContentPlaceHolderID attribute in the content page.
Wrox.master
<![CDATA[<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Wrox.master.cs" Inherits="Wrox" %>]]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:contentplaceholder id="head" runat="server" xmlns:asp="#unknown">
</asp:contentplaceholder>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="3" border="1">
<tr bgcolor="silver">
<td colspan="2">
<h1>My Company Home Page</h1>
</td>
</tr>
<tr>
<td>
<asp:contentplaceholder id="ContentPlaceHolder1" xmlns:asp="#unknown">
runat="server">
</asp:contentplaceholder>
</td>
<td>
<asp:contentplaceholder id="ContentPlaceHolder2" xmlns:asp="#unknown">
runat="server">
</asp:contentplaceholder>
</td>
</tr>
<tr>
<td colspan="2">
Copyright 2008 - My Company
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
WroxMozilla.Master
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/Wrox.master" AutoEventWireup="true" CodeFile="WroxMozilla.master.cs" Inherits="WroxMozilla" %>]]>
<asp:content id="Content1" contentplaceholderid="head" runat="Server" xmlns:asp="#unknown">
Mozilla!!
</asp:content>
<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="server" xmlns:asp="#unknown">
</asp:content>
<asp:content id="Content3" contentplaceholderid="ContentPlaceHolder2" runat="server" xmlns:asp="#unknown">
</asp:content>
Default.aspx
<![CDATA[<%@ Page Title="" Language="C#" MasterPageFile="~/Wrox.master" Mozilla:MasterPageFile="~/WroxMozilla.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>]]>
<asp:content id="Content1" contentplaceholderid="head" runat="Server" xmlns:asp="#unknown">
</asp:content>
<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="Server" xmlns:asp="#unknown">
</asp:content>
<asp:content id="Content3" contentplaceholderid="ContentPlaceHolder2" runat="Server" xmlns:asp="#unknown">
</asp:content>
Jon
|
|
|
|
|
Use the "Ignore HTML" option when you post markup code. Now I can't tell exactly which markup is yours, which was added by the forum, and what it is that isn't visible.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
GIVE 3 TIER ARCHITECTURE INTRODUCTION WITH SMALL EXAMPLE PROGRAM IN ASP.NET
|
|
|
|
|
Do your own homework. Try google.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Wow - they teach 3 tier ASP.NET projects in schools now ? Too bad you're going to fail.
Your caps lock key is stuck, too.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
GIVE ME ALL YOUR PATHETIC PAYCHECKS FOR THE REST OF YOUR LIFE.
Sounds unreasonable, doesn't it?
|
|
|
|