|
Code looks choppy there; shouldn't it be like this:
myDataSet.myTable.DefaultView(myDataGrid.CurrentRowIndex).Delete()
myDataSet.myTable.AcceptChanges
??? I wouldn't actually delete stuff from the grid as it is the underlying dataset you're trying to manipulate. Also make sure you apply "AcceptChanges" or the DS will not delete the record.
|
|
|
|
|
in other words...
i want to get the value of column(0) and row(i)
when i try this (column(0) row(0)), an exception occure "out of range"
Militiaware
Faris Madi
|
|
|
|
|
Do you want to get the value in a cell or delete the row? To simply get the value:
bindingContext(myDataset, "myDataTable").Current("myField")
This will give you the value in the current field.
|
|
|
|
|
Hi
I am using WMI to get information about running processes on a local machine in vb6. But in the case of cpu_percantage, it always shows 99% for wmiprsve process (which is in fact collecting data) and all other processes have 0% cpu usage!
I checked it in Task Manager, it shows only 2% for the named process and shows reasonable usages for other running processes....
Is there any way that I can get cpu percentages from WMI? Or any other ways to do so in vb6?
Thanks
|
|
|
|
|
you can change the header of the column in datagird in (Web Project)
but in Win Application and datagrid doesn't provide the ability to change the headers....
my question, how to change the header?
Militiaware
Faris Madi
|
|
|
|
|
try opening the help file.
look for "DataGridTableStyle.MappingName Property" it may prove to be exactly what you are looking for.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
that what i'm looking for..
in the web datagrid control you can find it....but not in the win datagrid control.
i tried to change the headers from the datagrid .... no solution where found.
i tried to change the headers from the dataset .... no solution where found.
and i believe there's a soution.. but where.....?????
Militiaware
Faris Madi
|
|
|
|
|
i have developed a web application in which i have make use of a single web form which will ivoke web service. In that form, i have used 3 textboxes and a dropdown list box. In that list box i have included 4 services as items. once if i choose a service/ operation, it does the operation which i want but when i try to choose another service/operation, it automatically doubles the amount of items already added into that drop down list box. y it happens? can any one know abt it?.. if so can u plz tell me that what i have to do for eleminating that?
thanks,
with regards,
K.Vijaya
|
|
|
|
|
It sounds like you are adding the items on each postback. You should only do that when you create the page the first time, e.g. when IsPostBack is false.
Translation:
it snd lk u r addn d items on each postbk. u shd only do dat when u create d page d first time, e.g. when IsPostBack is false
---
b { font-weight: normal; }
|
|
|
|
|
ya its working fine now.. what u gave here is really helpful to me.
thanks a lot
K.Vijaya
|
|
|
|
|
My computer used to give me low virtual memory warning when i work in vb.net and sql server 2000 simultaneously.
Then i incresed the size of virtual mem. After that the warning didn't come again. But now it has started again.
Plz smbdy tel me the solution to this problem.
Plzzzzzzzzzz
Thanks.
Swati
|
|
|
|
|
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect<br />
<br />
TamakiLabs.Show()<br />
Lab131.Hide()<br />
Lab134.Hide()<br />
Lab203.Hide()<br />
<br />
If TreeView1.SelectedNode.Name = "Lab 723-131" Then<br />
Lab131.Show()<br />
ElseIf TreeView1.SelectedNode.Name = "Lab 723-134" Then<br />
Lab134.Show()<br />
Else : Lab203.Show()<br />
End If
im wanting my system to show 4 different datagridviews, yet it only shows Lab134 datagridview no matter which node i click. I dont where my code is wrong, can someone please give me a clue as to where i have my mistake in my code.
|
|
|
|
|
Hi
I am trying to write an application that can read arabix text file
but he dose not do than ????????????
i try the same code in reading english file and it success !!!!!!!!
how i can solve this problem
please help me ............................
khaleel
|
|
|
|
|
Can you be more spesific?
What type of data are you trying to extract?
Can you post a part of the code?
Isaac Sasson
"I hate it. Java sucks. And Java's generics suck harder. And in general, Java just sucks."
- David Stone, The Lounge (May 1st 2006)
|
|
|
|
|
Hi
it is an text file
code
System ::String *strData = S"" ;
System ::String *m_strFileName= S"" ;
System ::IO ::StreamReader inFile =
new System ::IO ::StreamReader( m_strFileName ) ;
strData = inFile.ReadToEnd( ) ;
|
|
|
|
|
|
Hi Everyone:
I have not been receiving any ressponses lately, but we will try again.
I’m trying an experiment in ADO database connections. I have two MS-Access 2000 databases. One is password protected, the other isn’t.
I have two functions to make connections to the database using ADO.
With login data:
Public Function Jet_Connect_Login(ByVal strProv, ByVal strDB, ByVal strUser, ByVal strPasswd) As Integer
On Error GoTo Jet_Connect_Login_Err
Set cnnMainDb = New ADODB.Connection
With cnnMainDb
.ConnectionString = "Provider=" & strProv & ";Data Source=" & strDB & _
";User ID=" & strUser & ";Password=" & strPasswd & ";"
.Open
Jet_Connect_Login = .State
End With
Jet_Connect_Login_Exit:
Exit Function
Jet_Connect_Login_Err:
Select Case Err.Number
Case adErrObjectOpen
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Login_Exit
Case Else
Msg = "Error in Startup module - Establish_Connection function. " & vbCr & _
"Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Login_Exit
End Select
End Function
Without login data:
Public Function Jet_Connect_Std(ByVal strProv As String, ByVal strDBName As String) As Integer
On Error GoTo Jet_Connect_Std_Err
Set cnnMainDb = New ADODB.Connection
With cnnMainDb
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBName
.Open
Jet_Connect_Std = .State
End With
Jet_Connect_Std_Exit:
Exit Function
Jet_Connect_Std_Err:
Select Case Err.Number
Case adErrObjectOpen
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Std_Exit
Case Else
Msg = "Error in Startup module - Establish_Connection function. " & vbCr & _
"Error # " & Hex(Str(Err.Number)) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
If cnnMainDb.State = 1 Then
cnnMainDb.Close
Set cnnMainDb = Nothing
End If
Resume Jet_Connect_Std_Exit
End Select
End Function
The Connection function without the logon works fine, but the one requiring log on information is giving me the following error:
Error in Startup module – Establish_Connect function.
Error# -2147217843 was generated by Microsoft JET Database engine.
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
Thank you,
Quecumber256
|
|
|
|
|
Hi, does anyone out there know how to create a new class that inherits form System.ComponentModel.Design.CollectionEditor.CollectionForm? I've checked online and it seems that this can be done in C#, but I can't find any resources out there that explain how to inherit this class in vb.net. Thank you in advance.
C#:
public class MyCollectionEditor : CollectionEditor
{
protected class MyCollectionForm : CollecitonEditor.CollectionForm
{
}
}
VB.Net - Does not work, error msg:
"System.ComponentModel.Design.collectioneditor.collectionform is not accessible in this context because it is 'Protected'"
public class MyCollectionEditor
inherits CollectionEditor
protected class MyCollectionForm
inherits CollecitonEditor.CollectionForm
end class
end class
eatwork
|
|
|
|
|
You can start with this:
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Data
Imports System.ComponentModel.Design ' Important!!
Imports System.Windows.Forms ' Important!!
Public Class MyCollectionEditor
Inherits CollectionEditor
Public Sub New(ByVal type As Type)
MyBase.New(type)
End Sub
.
.
.
Private Class MyCollectionEditorForm
Inherits CollectionForm
Public Sub New(ByVal editor As CollectionEditor)
MyBase.New(editor)
.
. ' setup other form properties...
.
End Sub
Public Sub New(ByVal type As Type)
MyBase.New(type)
End Sub
Protected Overrides Function CreateCollectionForm() As CollectionForm
Return New MyCollectionEditorForm(Me)
End Function
End Class
End Class
I strongly suggest picking up Lutz Roeder's .NET Reflector and examine some existing collection editors before continuing. Also, I'd keep the MSDN documentation for CollectionBase, CollectionEditor, and CollectionEditor.CollectionForm bookmarked.
Keep in mind, that CollectionForm is just a normal Windows Forms Form. I wonder what you can do with that little tidbit...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello Dave,
Thank you for your reply, I will check out Lutz Roeders .NET reflector, and it seems as though all of the other collection editors available online are done through C#. But, I will continue the search online.
I tried your starter code, but I still have the same problem. Visual Studio 2003 does not recognize:
Private Class MyCollectionEditorForm
Inherits CollectionForm
because it says that it is protected. I was also not able to load the System.Collections.Generic library. Any ideas on why this is happening? is it because I don't have the generic library imported? Thanks
eatwork
|
|
|
|
|
That's beause I'm using 2005, not 2003.
They may have changed the CollectionForm protection between .NET 1.x and 2.0.
There is, also, no System.Collections.Generic namespace in .NET 1.x, so you don't have to include it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for your quick response dave. You wouldn't happen to know how to get around the protection problems with the CollectionForm in VS2003 would you? Thank you.
eatwork
|
|
|
|
|
hi,
I have to capture the keypress using the windows service. I have to store all the pressed values into database. Please help me to do this
Ramesh
|
|
|
|
|
Is there a way to modify the routing table from VB.Net or C#? I can get the IP address of a VPN connection on my computer but need to add an entry to the routing table to access the VPN.
Thx
Mark Jackson
|
|
|
|
|
You should not have to do this at all. If the VPN client is configured correctly, it handles this itself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|