|
You can't. NTFS does not track that information.
About the best you can hope for is to get the owner of the file. There is no way to map that user back to the IP address/machine name that they were using at the time.
|
|
|
|
|
Description: I have 1 textbox,button and one table.user entered data in the textbox and click save button the data is save to database table.i wrote some but iam getting some error
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'Dim ds As DataSet
If tbxNote.Text <> String.Empty Then
Dim NoteRow As ChemComp_adminDS.GeneralNotesRow = m_ccDb.Chemcomp_adminDS.GeneralNotes.NewGeneralNotesRow
'Dim crow As DataRow = ds.Tables("GeneralNotes").Rows(0)
'User entered comment for this susbstanceID for the first time so new row to be inserted in
'to AdminComment table
' NoteRow.NoteID = CInt(NoteRow.Item("NoteId"))
NoteRow.CreatedBy = My.User.Name
NoteRow.CreatedOn = Now
NoteRow.ModifiedBy = My.User.Name
NoteRow.ModifiedOn = Now
NoteRow.Note = tbxNote.Text.Trim()
m_ccDb.InsertRow(NoteRow)
End If
'm_ccDb.GetList(m_ccDb.Chemcomp_adminDS.GeneralNotes)
End Sub
End Class
at the time of insertrow function iam getting the following error.
Cannot insert explicit value for identity column in table 'GeneralNotes' when IDENTITY_INSERT is set to OFF.
|
|
|
|
|
Do not try to insert the primary key value in the database. It is set as a auto generated column.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi,
I wrote a program original in VB6 (I know it's old) and now in vb.net 2008.
When the program reads music files in some cases(most of the time on vista machines but sometimes on XP) the duration returns 0. Is there another way of retrieving the lenght of an mp3/wma file rather than open it into a mediaplayer control or a solution so that it 'always' returns the write time
Thanks Jan
|
|
|
|
|
|
Hi All,
I have made a project in VB2008 in which I have bind my Grid to Class as a datasource. The column names of Grid are the property names of the class. But I need to have customize column names for my properties in the Grid. One way is to add an attribute <displayname("name")> _ for example before each property. But it is so hard to name each and every property as i have thousands of properties in this project. Someone has told me that there is a way by using IListSource.. Does anyone have any idea about that??
Regards
Ovais
|
|
|
|
|
You could just create the columns in the grid yourself, then just setup the bindings for each column to property yourself.
|
|
|
|
|
Thanks for your reply dear, but I have only one grid which is binded by different classes at different scenarios..
For e.g.
Instead of having separate grids for Employees, Leaves, Allowances, Deductions (to show thier respective detail), i've a single grid. When i hit Employees button, it fills with Employees class, when i hit Leaves button, it fills with Leave class, and so forth..
Hope you understand my problem.
Ovais
|
|
|
|
|
Ovais Memon wrote: Instead of having separate grids for Employees, Leaves, Allowances, Deductions (to show thier respective detail), i've a single grid. When i hit Employees button, it fills with Employees class, when i hit Leaves button, it fills with Leave class, and so forth..
Then if you are able to, I would suggest that you have a Form for each category. Apart from this allowing you to do as previously suggested for the column binding, it will enable your users to do side-by-side comparisons between datasets.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
So what's stopping you from Clearing the Columns collection and creating a new set of columns in the same grid and binding those to the new object collection?
|
|
|
|
|
Thats what i was doing so far, but the problem is that i m unable to customize column names in the grid. Acc. to your suggestion, i suppose to name the columns for each class at the time of binding with the grid..
|
|
|
|
|
Each DataGridViewColumn derivative allows you to set the columnheader text, using it's HeaderText property, seperately from the column name it's bound to.
|
|
|
|
|
I do exactly the same in my main form, 1 DGV and throw tables at it. I have a static method that formats names according to the capitilasition eg "ContactID" becomes "Contact ID" and I use this to populate the header text, it is part of a method that is used to bind all DGVs and gives me a consistent format throughout the app. It also means you need to take your conventions all the way back to the database design. As I own the DB I have no problem with this.
My problem is that if you bind to the List<class> using the public properties you lose the sort/filter capabilities unless you implement iBindingList (I think) on each of your classes which is a PITA. So Ah Ha I though, turn each class into a datatable, at which point I chucked the entire bind to class list out and just bind to the original datatable.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am working on a windows application where the user should be able to move,resize and drag and drop a control (a Textbox in my case).
I am pretty much ok with the moving and drag and drop except that I cant differentiate between MouseDown and Click events, because everytime I press the mouse button on the control the MouseDown event fires up and I cant really use the click event. Is there a way that i can differentiate between MouseDown and Single Click.
Second: I am trying to highlight the control when the user selects the objects so that I highlight the control or get that resizing rectangle around the control so that user can drag it to resize the object. Something we do while creating a application (we add a control on the form and then resize it) . Can any one please help me out with this.
Thanks
If you can think then I Can.
|
|
|
|
|
As for differentiating MouseDown from Click , you can start a timer when MouseDown is fired. If you get a MouseUp before the timer expires, then it's a Click, otherwise it's starting a drag-and-drop.
Highlighting the control can be done for example by using the OnPaint event and adding GDI+ code to draw your highlighting depending on the component status (drag-and-drop active or inactive).
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Sorry sir,
Please Explain in brief or give me any suitable example.
If you can think then I Can.
|
|
|
|
|
This is a very raw example, it should give you the basic idea:
private bool DragActive = false;
System.Threading.Timer DragOrClickTimer = null;
private void DragOrClickTimer_Tick(object state)
{
DragActive = true;
Control c = (Button)state;
c.Invalidate();
}
private void button1_MouseDown(object sender, MouseEventArgs e)
{
DragOrClickTimer = new System.Threading.Timer(new System.Threading.TimerCallback(DragOrClickTimer_Tick), button1, 200, System.Threading.Timeout.Infinite);
}
private void button1_MouseUp(object sender, MouseEventArgs e)
{
if (DragOrClickTimer != null)
{
DragOrClickTimer.Dispose();
DragOrClickTimer = null;
}
if (DragActive)
{
DragActive = false;
button1.Invalidate();
}
else
{
MessageBox.Show("Click!");
}
}
private void button1_Paint(object sender, PaintEventArgs e)
{
if (DragActive)
{
Graphics g = e.Graphics;
Pen p = new Pen(Color.Red, 3);
g.DrawRectangle(p, 5, 5, button1.Width - 11, button1.Height - 11);
}
}
Of course it should be incapsulated properly in custom controls, or if you just want to implement it simply in a form, tweaked to work for all controls - the basics are all there.
Good luck!
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Thanks for help but i am using your code and it's not working.
If you can think then I Can.
|
|
|
|
|
It's copy and paste from a working example.
You can adjust the timer setting (it's 200 ms in my example) and play around with the code to adapt it to your needs, but I assure you it's working.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
eg_Anubhava wrote: user should be able to move,resize and drag and drop a control (a Textbox in my case).
I'll leave it to others to help you with most of this, but you might find it difficult to resize a TextBox, depending on what properties are set. AFAIK you can only resize a non-multiline TextBox horizontally, so you will need to consider this when implementing your drag-handles.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: AFAIK you can only resize a non-multiline TextBox horizontally only
FTFY
(and you could change font sizes to get different TB heights)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Why thank you.
Luc Pattyn wrote: (and you could change font sizes to get different TB heights)
True, but could end up really, really ugly.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
HI,
I call a child form as such
dim frm as new childform
frm.showdialog()
I need for childform to be inside the MDIparent form without having it to go outside the scope of the Mdiparent
so before I call frm.showdialogue() i need to do something.
thanks alot
|
|
|
|
|
If you show the child form using ShowDialog, it cannot be an MdiChild.
|
|
|
|
|
Thanks,
what if I change it to show()
Can it be then a MdiChild and how
Best regard
|
|
|
|