|
MissionSuccess wrote: I know that i have to use SqlDataReader
Not true. There are numerous ways to define a data source.
You can set up the GridView, at least, to do this for you, but I prefer to write controls for the links and write a stored proc that takes a page number and count, and handle it myself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Agreed SqldataReader is forward only....
But how can i achieve this...without any grid
I have a no of data for a record so i am not using datagrid.
I am showing it in different textboxes and dropdowns.
On the click of next or previous button the respected textboxes and dropdowns shd be filled automatically with the correct data.
Ajay Kumar
|
|
|
|
|
Hi all
I am not sure to post this question is suitable or not.
How/Can I select the columns of entire database tables? I am going to clear about the question.
For select all columns of one tabble.
Select * from TableName.
Similarly, what is the query for select * from *(all tables inside a database).
Thanks
|
|
|
|
|
If there is, then the SQL forum is the place to ask. I doubt it very much tho. For starters, that query can't work, b/c it doesn't establsih joins between tables, nor can it. I'm sure there's a SQL Server proc to find all tables in a DB tho.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi,
I have a problem with maintainScrollPositionOnPostBack. I tried to set it both in web.config and in the page itself. But whenever I do a postback the page is reset to the top. The code does seem to be in the source:
<div><br />
<br />
<input type="hidden" name="__SCROLLPOSITIONX" id="__SCROLLPOSITIONX" value="0" /><br />
<input type="hidden" name="__SCROLLPOSITIONY" id="__SCROLLPOSITIONY" value="0" /><br />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQK5pZrtBAKe1IqoDgK4/rF4Aqej2csJAuKqvZkDQeYzTVDEMVPMi9O+ZVyKPzO+3xc=" /><br />
</div><br />
<br />
<script type="text/javascript"><br />
<br />
theForm.oldSubmit = theForm.submit;<br />
theForm.submit = WebForm_SaveScrollPositionSubmit;<br />
<br />
theForm.oldOnSubmit = theForm.onsubmit;<br />
theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;<br />
</script>
The name of the site is www.entropedia.info. Anyone know what I am doing wrong?
|
|
|
|
|
Hi,
I used requiredFieldValidator in my web application and locally it's OK but when I publish it on my host, it don't work.
My host support ASP.Net 2.
Best wishes
|
|
|
|
|
Well, logically, that just can't be true unless there's something you're not telling us. A required field validator isn't going to change based on what hard drive or server it's on.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello friends,
I am using GridView to display my data. I wanted to enable a linkbutton located in a column of that grid on selectedindexchange. Is it possible? if yes ..how ?
thanks..in advance
Amit
|
|
|
|
|
You'll need to know the ids of your differnt buttons and do it using javascript. Unless you do a postback every time, which is ugly in this day and age.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have developed an website in microsoft visual studio 2005 using asp.net
will it work properly in visual studio2003????
|
|
|
|
|
|
No, there were major changes between 2003 and 2005, so even if you had not used any new .NET 2.0 language features, I doubt it will work.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hello. First of all I'm programming in VB.NET/ASP.NET doing a page for a website. Now, to my question....
I have a simple array of integer numbers (15 characters in length) which can hold up to 2000 items. What I basically need to do is output these numbers to a PDF file I'm creating on the fly and I can only fit a certain amount of numbers per page. What I need to do is just output these on each page in numerical order vertically NOT horizontally. Based on page size restrictions, the amount of numbers I can output per page is 19 rows x 7 columns (or 133 items total).
Now, I already have the PDF creation going fine, including adding more pages as there's more numbers being added, etc. It's just the sorting of these numbers that I'm outputting I'm having trouble with. What I'm doing currently (which is archaic), since I can only output horizontally at the moment, is outputting the first number, then skipping the next 18, and then outputting the next number, then skipping the next 18, etc. Once I get to the 7th number (1st row, 7th column), I output it, skip backwards to the 2nd number in the array, and output it as I'll now be in the 2nd row (2nd row, 1st column). I keep doing this until all numbers in the array are output. The only problem is that, other than being finicky and definitely not an efficient way of doing it, is if the array has fewer than 133 numbers (or if by chance there's fewer than 133 numbers on any one page), the output structure is all messed up.
For more info on what I'm currently doing, here's some code examples:
Dim theTagArray(2000) As String<br />
' theTagArray is filled before this next section...<br />
<br />
Dim thecount2 As Integer = 0<br />
Dim thecount3 As Integer = 0<br />
Dim thenum As Integer = 19<br />
' Nice mess to print tags in numeric order down each column, left to right...<br />
' Basically, start with first element, then skip 18 and put next, skip 18 put next, etc. and so forth...<br />
' pdfText2a.Add is the function that's basically outputting the array element... to the PDF...<br />
If thecount3 = 7 Then<br />
thecount2 += 1<br />
thecount3 = 0<br />
pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ")<br />
thecount3 += 1<br />
Else<br />
pdfText2a.Add(theTagArray(thecount2 + (thecount3 * thenum)) & " | ")<br />
thecount3 += 1<br />
End If
I want it to look kind of like this:
982000018301450 | 982000018561709 | ...<br />
982000018561265 | 982000018561724 | ...<br />
...
Though 7 across, 19 down.
So, this is why I'm asking if there's a way to output an array vertically instead of horizontally in either a slightly more efficient way than I'm doing it, or by using a much better method altogether. Please help if you can. Thanks for your help.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
|
|
|
|
|
There is no way I see to display an array vertically, but you can surely try putting your data in some DataTable vertically with an array and then print horizontally from the table to match your required output
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
Oh, I wish it were that easy. But due to how the code works on creating the PDF pages, the only way I know of is to extract the elements of the array one by one. Unless, I guess, I somehow created several different datatables or something to span across the several PDF pages, but I would be confused on how to even go about that. I 'could' use something else other than an array to store the numbers, but just not sure what would be best here.
Any other suggestions? Thanks.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
|
|
|
|
|
Use a multi-dimensional array: Array(2000,7)
One dimension is the verticle and one dimension is you horizontal.
|
|
|
|
|
A 2D array is the easiest solution, I reckon, but for future reference, I use a Repeater when I need to output data in a custom format. Then you can do stuff like this easily, because you have full control.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes, I understand a 2D array would probably be easiest, but how do I make it work? Remember, as I'm creating this PDF, I can only have 19 rows and 7 columns per page (133 numbers total per page). So if I have 2000 numbers, I can't just fill a 2D array up completely with that as them the order would be screwed up if I tried to split the array up during the output onto the page. Because I need to have the first 19 numbers on the first column, then the next 19 numbers on the 2nd column, the 3rd set of 19 numbers on the 3rd column, etc. until I get through the first page. Then I create a new page and start over except I'm technically on the 8th set of 19 numbers starting at column 1 again on this new page. This goes on until all numbers are output for however many pages. So it's like I would need to create a new 2D array per page, on the fly, making sure I don't overlap or skip any numbers (which are being pulled from my SQL database) and then output each number out from that array.
So this is where I'm stuck as either I'm making it way too difficult or I'm missing something. Thanks for your help.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
|
|
|
|
|
If you had a 2D array then you can use a DataGrid to display the data. Or you can just iterate over the rows and output them, just as if you were writing printing code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Excuse me for my inexperience, but how can I have a datagrid do this since all I have are numbers? I'm not binding certain columns or anything, all of the data is the same, a bunch of numbers. So how I normally would create some bound columns and bind that to a SQL query which would contain certain fields of data matching the bound columns, all I have now is technically one field of data which needs to span 7 columns and go through 19 rows and this needs to happen on a per page basis for the PDF file I'm creating using itextsharp.
I think I'm just making this much harder than it is but I still see no easy solution. I have a bunch of numbers in a database (all in a single field) and I need to print them on the screen in order vertically per column spanning over pages I'm creating via a PDF file. I wouldn't think it could be hard, but everything I try is failing.
Thanks again.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
|
|
|
|
|
An array is a perfectly valid data source for any data bound control.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
*sigh* Nevermind, but thanks for your help.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
|
|
|
|
|
Hi Everyone,
how can change the date format. my default date formate is dd.mm.yyyy, i need to change mm/dd/yyyy.
i am using the function to change, but its not working properly.
private DateTime Getdate(string date)
{
DateTime dt = new DateTime();
if (date.Contains("/"))
{
char cPipeSign = '/';
string[] str = date.Split(cPipeSign);
dt = new DateTime(int.Parse(str[2]), int.Parse(str[0]), int.Parse(str[1]));
}
else if (date.Contains("."))
{
char cPipeSign = '.';
string[] str = date.Split(cPipeSign);
dt = new DateTime(int.Parse(str[2]), int.Parse(str[0]), int.Parse(str[1]));
}
return dt;
}
it returns the dd.mm.yyyy
|
|
|
|