|
Hi all ,
I am using Asp.Net 1.1.. How can Enumurate all the rows in a datagrid ? .This works in 2.0. But what about 1.1
For each Row as GridViewRow in GridView1.Rows
Next Row
Thanks in advance
Dana
modified on Thursday, January 17, 2008 7:20:50 AM
|
|
|
|
|
There's a clue in the variable types here, if you look for it... Or you could look at what type of row a collection of rows in a datagrid contains.
|
|
|
|
|
dear all,
i have developed a web application using asp.Net 2.0, i have a database,site on X machine (works as domain). i have access that site from client Y machine.
Application copy the file from Z machine to X machine, Z machine under the domain (X machine). i have copy file with following code
my.computer.network.download("http://IP of Z machine/folder/fileName","Location on X machine")
when i execute the code it will throughs an execption of "UnAuthorisation" on above code.
i have login on Z machine from X machine (with IP and Computer name also)
where i am wrong???
what should i do?
please help...
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
can any one help me to create a vb.net application in which i have a list view control with print command
thanks in advance
|
|
|
|
|
how to create administrator username,password and user username,password in only one login control?
|
|
|
|
|
Basheer wrote: how to create administrator username,password and user username,password in only one login control?
You might want to rephrase that because it doesn't make much sense.
|
|
|
|
|
i am developing an website for online billing of computer parts.
here i want to allow users to select a part number , then the price and part number should come automatically. This i need to get in a grid format.
eg:
partno name quantity price total
1001 part1 1 100.00 100.00
Initailly i just want to show one row only.. and in that need to show the combo box only..
The partno is taken from parts table and this will be inserted to invoiceitem tables
Can i use datagrid for this? Please help me for a solution
regards
Hari
|
|
|
|
|
Yes you can use datagrid for this purpose (displaying set of records from the database).
Apurva Kaushal
|
|
|
|
|
Hello,
I have created a placeholder to will contain labels and textboxes based on the users choice from a dropdown. I would like to place every label and textbox in a seperate td in a table. How can I create a td for every label and textbox? Thanks.
Here is part of the code:
<asp:DropDownList ID="NumOfQuestionsDropDown" runat="server" AutoPostBack="True" OnSelectedIndexChanged="NumOfQuestionsDropDown_SelectedIndexChanged" >
</asp:DropDownList>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
void CreateLabelsTextBoxes()
{
int n = Int32.Parse(NumOfQuestionsDropDown.SelectedItem.Value);
// create n Labels and TextBoxes, and add them to the PlaceHolder TextBoxesHere
for (int i = 0; i < n; i++)
{
PlaceHolder1.Controls.Add(new Label());
PlaceHolder1.Controls.Add(new TextBox());
}
// Set the Text property of each Label
IterateThroughChildren(this);
}
void IterateThroughChildren(Control parent)
{
int count = 1;
foreach (Control c in parent.Controls)
{
if (c.GetType().ToString().Equals("System.Web.UI.WebControls.Label") && c.ID == null)
{
((Label)c).Text = "Question" + count;
count++;
}
Response.Write("Type= " + c.GetType() + "<br />");
if (c.Controls.Count > 0)
{
IterateThroughChildren(c);
}
}
}
protected void NumOfQuestionsDropDown_SelectedIndexChanged(object sender, EventArgs e)
{
CreateLabelsTextBoxes();
}
|
|
|
|
|
My database is sql server 2000 ,I have a name and date colums in a table . How should I write the query to find all the names which lies in the particular year , In order to access it from --- the asp.net c# code behind file?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
The raw SQL would be something like this:
SELECT MyName FROM MyTable WHERE DATEPART(year, MyDate) = @MyYear
That should be wrapped up into a stored procedure
CREATE PROCEDURE GetNames
@Year int
AS
SELECT MyName FROM MyTable WHERE DATEPART(year, MyDate) = @Year
GO
You can then write the C# code (from anywhere, as it is ADO.NET that connects to the database - It has nothing to do with ASP.NET)
using(SqlConnection conn = new SqlConnection(myConnectionString))
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "GetNames";
cmd.CommandType = CommandType.StoredProcedure;
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
string name = reader.GetString(0);
}
}
|
|
|
|
|
Thank You Sir.
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Hi ,
I am dilip new to .net but worked little much.
From table extacting OR selecting any particular rows which has some common properties c an be done using SELECT statement of the SQL.
For your table, query is something like "SELECT myname FROM mttable WHERE mydate=@date"
It' so simple.
Thanks & Regards
Dilip
.Net Consulting
|
|
|
|
|
Hello ,
I am working with an WebService. The current webserivce returns the dataset. Now one of the column in datatable is Author and the author is comma separated.
Example
AuthorName | BookName | Price
Blaze-Tony,Ron-Moraldo| Basic C# | 20
Blaze-Con,Bob-Moraldo | ASP.NET | 20
I want the result of the webservice to be in below format:
The Author names are comma seprated and I will do the split part.
<Table diffgr:id="Table1" msdata:rowOrder="0">
<AUTHORLIST>
<AUTHOR>
<FIRSTNAME>blaze</FIRSTNAME>
<lASTNAME>tony</lASTNAME>
</AUTHOR>
<AUTHOR>
<FIRSTNAME>RON</FIRSTNAME>
<lASTNAME>Moraldo</lASTNAME>
</AUTHOR>
</AUTHORLIST>
<BOOKNAME>Basic C#</BOOKNAME>
<Price>20</Price>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<AUTHORLIST>
<AUTHOR>
<FIRSTNAME>Con</FIRSTNAME>
<lASTNAME>Blaze</lASTNAME>
</AUTHOR>
<AUTHOR>
<FIRSTNAME>Bob</FIRSTNAME>
<lASTNAME>Moraldo</lASTNAME>
</AUTHOR>
</AUTHORLIST>
<BOOKNAME>ASP.NET </BOOKNAME>
<Price>20</Price>
</Table>
How shall I achive the same in above XML format. Check the <AUTHORLIST> tag?
Please tell me the approch?
Regards,
Pavas
|
|
|
|
|
Hi all,
How can I maintain the state of checkbox in a gridiview during postpack(VS2003)
Thanks in Advance
Dana
|
|
|
|
|
danasegaranea wrote: gridiview during postpack(VS2003)
ASP.NET 1.1 don't have a GridView control. Do you mean DataGrid ? DataGrid can maintain it's controls state if viewstate is turned on. It will do this automatically. Make sure you are binding the grid in not ispostback block.
|
|
|
|
|
Yes it is a Datagrid only. If I do in the Binding in the Not isPostBack event, then the Paging is not working
|
|
|
|
|
You need to bind the grid again after changing the page number
|
|
|
|
|
I do like this
Private Sub dgResources_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgResources.PageIndexChanged
dgResources.CurrentPageIndex = e.NewPageIndex
dgResources.DataBind()
End Sub
But is not maintaing its state.
Bye the way I am using this code to check whether the check box is checke / uncheked.Even the checkbox is check it is giving the value Checked = False always
For i = 0 To dgResources.Items.Count - 1
chk = (dgResources.Items(i).Cells(0).FindControl("chkResource_First"))
If Not chk Is Nothing Then
If chk.Checked = True Then ' Always false.
'Do some thing
End If
Else
End If
Next
|
|
|
|
|
danasegaranea wrote: dgResources.CurrentPageIndex = e.NewPageIndex
dgResources.DataBind()
You are not setting the data source.
|
|
|
|
|
Hi all,
How can I get all the rows/columns of a datagridview in VS 2003.
Thanks
Dana
|
|
|
|
|
What is the problem you are having in looping through the rows or columns of the datagrid. You can always get the row or count of the datagrid and then loop through with that.
Apurva Kaushal
|
|
|
|
|
there are nearly 10 items in the dropdown list now how can i make the 2,4,6,8 items to disable not to view to the user
|
|
|
|
|
Isn't this the same as your previous question. Anyway, the answer is the same. It can't be done.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Why don't remove these items you want to disable ?
imagic
|
|
|
|