|
Hi guys,
I am an intermediate when it comes to the repeater control. I would like to restrict the repeater to get the first 5 columns of the table.
Is there a way to accomplish this without paging? Paging is more complex for a repeater and I would like to avoid it. I do no even need paging, just the first 5 results.
Thanks for any help or hints!
|
|
|
|
|
How about restricting the data that you load, with a SELECT TOP 5 FROM [blah] ?
I are Troll
|
|
|
|
|
I need to determine who created a file on a Windows Server network drive, and depending on which user created it, do some additional processing on it.
All is working well except for determining who created the file. If I right-click on the file select properties and then the Details tab, there is a property call "Owner", which would be the obvious place to obtain the detail I require, but so far I have not been able to find away of reading this information with VB.NET 2008.
By the way, these files are NOT MS Office files.
Any pointers?
Thanks
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
File.GetAccessControl gives you a FileSecurity object, which has a GetOwner method. Does that give you what you are looking for?
|
|
|
|
|
David Skelly wrote: Does that give you what you are looking for?
Yes, yes, yes. I love you. I want your babies. Well actually, possibly, I wouldn't go that far, but yes, does exactly what I need. Thanks very much.
Regards
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
With one big caveat.
GetOwner returns the current owner. When a file is created, the owner will be the person who created the file, but this can be changed easily by anyone with sufficient permission.
|
|
|
|
|
Gregory.Gadow wrote: GetOwner returns the current owner. When a file is created, the owner will be the person who created the file, but this can be changed easily by anyone with sufficient permission
Not a problem. i have written a program to process data within the file as soon as it is created.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
mates,
need help. how to insert new row between two rows in bound datagridview or unbound datagridview?
For example i select row 1 then when i click button insert then row2 will be inserted.
In short,
example:
row1
-------row2 ->inserted row
row3
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Simply you can use the DataGridView's DataSource, like the below...
Dim MyDtb As New DataTable
DataGridView1.DataSource = MyDtb
blah...blah....blah....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
MyDtb.Rows.InsertAt(MyDtb.NewRow, DataGridView1.CurrentCell.RowIndex)
End Sub
|
|
|
|
|
In a Data Bound DataGridView, you have to repopulate the Data Source, as far as I know you can only insert rows at the bottom of the grid, but I may be wrong. In an unbound DatGridView you can use DataGridView.Rows.Insert which has 3 overloads, each requiring the row index in which to insert the row and either an array of values to populate the row, or an existing row, or the number of rows to insert. Hope this helps
|
|
|
|
|
If the DataGridView is bound, then you need to insert the row in the DataSource (you don't need to refresh the grid normally)
|
|
|
|
|
@Paramu1973
thank you. it's work in unbound datagrid.
@zimvbcoder and @jpaulino
i test your suggestion and its also work but the problem is it will insert at the last.
i want it to insert in the middle of 2 rows.
note. i use the dataset wizard just like this
Me.WKTableAdapter.InsertQuery(prm1, prm2, prm3)<br />
Me.WKTableTableAdapter.Fill(Me.DsWKTable.WKTable)
-->this will refresh grid
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
|
Based off the information provided I can offer you two entirely foolproof solutions.
Split your program into two programs, therefore programming yourself out of a corner.
or
Rewrite your program into two programs, therefore programming yourself out of a corner.
See how helpful answers can be when you provide no information at all? Just imagine the possabilities when you don't waste my time provide actual details.
|
|
|
|
|
I suggest you go and watch some of the video's over at MSDN
Look at the Forms Over Data series, Understanding Data and the one's relating to N-Tier subjects.
From these you can then start to look at exactly what you are trying to achieve, when you mean split do you mean client side N-Tier layers, or are you looking to consume web services etc.
http://msdn.microsoft.com/en-gb/vbasic/bb466226.aspx[^]
|
|
|
|
|
I do not even know where to start with this request, but I need to be able to write some text to about 40 years worth of a MS Outlook Calendar. Is it possible to programmatically write to a MS Calendar in Outlook in a loop?
<br />
for each item in Microsoft.Outlook.Calendar(myName@email.com)<br />
<br />
Outlook.Date.Text = "Text to Write"<br />
<br />
Next<br />
Are there some articles about writing code for Outlook Calendars that you could point me to? Any assistance would be appreciated.
|
|
|
|
|
|
I have just purchased Visual Studio 2008 professional edition. I am trying
to learn how to populate nodes on the Treeview from a database. I have
found several websites that have the code I need but they all rely on
my having the "microsoft.web.ui.webcontrols" namespace.
But that's just it! When I try to include this namespace, it says it does
not exist. What's that all about? Why haven't i got it, and where can I get it?
Man, this is annoying!
|
|
|
|
|
That will be for a web based application.
You need to look at windows forms controls examples. [unless of course you are trying to create a web app]
|
|
|
|
|
Thanks Dave, in fact i am trying to create all this in a web site.
Can you still help?
|
|
|
|
|
|
Thanks again Dave,
However, when I try and load the reference System.Web.Extensions, the popup dialog shows
it in the .NET list, I highlight it and click "OK" but nothing happens and "Extensions" is still not available from System.Web.
Any ideas?
|
|
|
|
|
How about starting from a fresh project?
1) Open VS
2) Create Project
3) VB Projects / Web Project
4) ASP.Net Web Application; Also check on this dialog what your version of the .Net Framework, you are targeting.
What Reference do you have as default?
With My setup I get for a .Net 3.5 Target;
System
System.Configuration
System.Core
System.Data
System.Data.DataSetExtensions
System.Drawing
System.EnterpriseServices
System.Web
System.Web.Extensions
System.Web.Mobile
System.Web.Services
System.Xml
System.Xml.Linq
|
|
|
|
|
Thanks Dave,
I followed your instructions but I have no idea how to check
what references I get as default like in your list. I tried googling
"how can I check..." but got nothing" - could you just clarify
what I need to do here
thanks for your patience
Paul
|
|
|
|
|
There are 2 ways to do this;
1) From the Solution Explorer pane, click the "Show All Files" button at the top, then look under the References Node of the treeview
2) From the Solution Explorer pane, double-click "My Project" and then the References Tab, and look at the top list
|
|
|
|