|
akmckd wrote: Can U Help Me .
I would say it is very unlikely, most of us moved on from VB more than YEARS ago and will no longer have expertise in a dead language.
You should not be putting your effort into a VB6 development but looking at rewriting the application using Visual Studio Express[^] which is FREE and includes VB.Net.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Publishing your email address (and phone number also) is considered an invitation for sending spam to you.
By the way, there are fora which block people who publish email addresses!
|
|
|
|
|
akmckd wrote: i Need Some Help Then you need to explain exactly what help.
|
|
|
|
|
Please be gentle, my first post. I am new at vb.net and am need help syncing my textbox and data grid so that when I move to the next record in the textbox the grid view also moves to the new row. Listed is my code, help would be greatly appreciated.
Private Sub OpenDataGrid()
Dim sql As String
'********************* Populate DataGrid *********************
Try
sql = "SELECT * FROM TempCreditors;"
MyConn = New OleDbConnection
MyConn.ConnectionString = connString
ds = New DataSet
tables = ds.Tables
da = New OleDbDataAdapter(sql, MyConn)
cm = New OleDbCommand(sql)
da.TableMappings.Add("MyTables", "MyTables")
da.FillSchema(ds, SchemaType.Source, "TempCreditors")
da.Fill(ds, "TempCreditors")
Dim view As New DataView(tables("TempCreditors"))
grdDisplay.DataSource = ds
grdDisplay.DataMember = ds.Tables("TempCreditors").TableName
Catch ex As Exception
MessageBox.Show("Unable to connect to database, or an error occurred.")
End Try
'********************* End Populate DataGrid ******************
Binding_Source.DataSource = ds 'grdDisplay.DataSource
Binding_Source.DataMember = ds.Tables("TempCreditors").TableName 'grdDisplay.DataMember
'Bind Form's Textboxes
txtCreditor.DataBindings.Add("text", Binding_Source, "Creditor", False)
txtAmount.DataBindings.Add("Text", Binding_Source, "Amount", False)
txtAmtPaid.DataBindings.Add("Text", Binding_Source, "Amt Paid", False)
txtRemBal.DataBindings.Add("Text", Binding_Source, "Rem Bal", False)
'Right Align GridView text
grdDisplay.Columns("Amount").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
grdDisplay.Columns("Amt Paid").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
grdDisplay.Columns("Rem Bal").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
With grdDisplay
'Set Column Properties
.Width = 610
.Columns("Creditor").Width = 250
.Columns("Amount").DefaultCellStyle.Format = "c"
.Columns("Amt Paid").DefaultCellStyle.Format = "c"
.Columns("Rem Bal").DefaultCellStyle.Format = "c"
'Hide Columns
.Columns("ID").Visible = False
.Columns("Due Date").Visible = False
.Columns("Paid").Visible = False
.Columns("Mid Month").Visible = False
.Columns("End Month").Visible = False
.Columns("Due Month").Visible = False
' .Columns("Rem Bal").Visible = False
.Columns("Pay Date").Visible = False
.Columns("Deduction").Visible = False
End With
'Bind Grid to Nav buttons
MyCM = CType(BindingContext(Binding_Source), CurrencyManager)
MyCM.Position = 0
' grdDisplay.Rows(0).Selected = True
End Sub
JLS
|
|
|
|
|
josephls wrote:
Add another entry at that point.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi.. Am Trying disable taskmanager through button click in vb.net but it gives me error .
registry access is not allowed.
But i have logged in as ADMIN only..
Below is the code am using....
Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
systemRegistry.SetValue("DisableTaskMgr", 1)
systemRegistry.Close()
End Sub
|
|
|
|
|
If you're getting "Access Denied", you're not running the code as an Administrator.
Since you're putting the value under CurrentUser, this will only disable Task Manager for the user running the code and not disable it for everyone who uses the machine.
|
|
|
|
|
I don't think that key exists in HKCU. Use regedit to check.
|
|
|
|
|
Under your Solution in your project name, (Click show all files button above your solution) there is a folder called my project, expand it and open the app.config. Change this line:
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> to one of these:
<requestedExecutionLevel level="requireAdministrator" uiAccess="true" />
<requestedExecutionLevel level="highestAvailable" uiAccess="true" /> You can elevate your application to admin level by using the below code:
.NET
Dim RunAdminMode As ProcessStartInfo = New ProcessStartInfo()
RunAdminMode.UseShellExecute = True
RunAdminMode.WorkingDirectory = Environment.CurrentDirectory
RunAdminMode.FileName = Application.ExecutablePath
RunAdminMode.Verb = "runas"
Try
Dim p As Process = Process.Start(RunAdminMode)
Catch RunAsAdmin As Exception
Return
End Try
C#
ProcessStartInfo RunAdminMode = new ProcessStartInfo();
RunAdminMode.UseShellExecute = true;
RunAdminMode.WorkingDirectory = Environment.CurrentDirectory;
RunAdminMode.FileName = Application.ExecutablePath;
RunAdminMode.Verb = "runas";
try {
Process p = Process.Start(RunAdminMode);
} catch (Exception RunAsAdmin) {
return;
}
Regards,
CodingK
|
|
|
|
|
I would like to learn visual basic - so I bought a book but I don't even know what software to buy to program with. I want to learn how to program for CAD applications but I would like to play and have fun with VB as well. I don't want to spend a bunch of money if I don't have to however if I have to then I will be happy to do so. My problem is that I am brand new and don't know the best way to get started.
I just bought the book: Beginning Visual Basic 2012 by Bryan Newsome.
Any advice would be greatly appreciated.
Thanks!!
Kaz
|
|
|
|
|
|
|
Get a copy of Visual Studio Express from Microsoft[^]. It's free and provides everything you need to get started. There are also hundreds of articles here on CodeProject, and in the wider community that will help you.
|
|
|
|
|
Thank you sir for your response and great suggestion - I appreciate your time!
|
|
|
|
|
If you are just starting out consider learning c# instead of VB, the reason, there are dramatically more examples and support resources for c# than there is for VB.net, unless of course your CAD application uses VB for it's scripting language.
And you still need visual studio express.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you sir for your response. I took a class in C 20 years ago and still have a bit of it in the back of my mind. My only problem is the CAD scripting is in VBA so I would like to learn VB if possible. Thank you for your Visual Studio Express suggestion.
|
|
|
|
|
Be a little careful that you are working with the correct platform, VBA is very different from VB.net. I would check if the CAD is using the old VBA, based on VB6 or VSTO which will be using VB.net.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for your response. - CATIA is the CAD system I use - from my understanding it uses VBscript VBA and CATscript. I figure learning any VB type code will give me better skills when I go into the VBA scripting even though it is different.
Thanks
|
|
|
|
|
I would like to add everytime I mention VBA to my programing friends they all make wrinkled faces and shake their head - I realize it is a dead language but CATIA is very much alive and used by the vast majority of the aerospace biz. Thanks for your suggestions
Kaz
|
|
|
|
|
I have the following code where I am updating a new field to a Table. I tried using the NULL in my statement and it does create the field but the Allow Zero length is still false in the table.
Can anyone show me the errors of my ways?
Dim sql As String
Dim connection As OleDbConnection
Dim connetionString As String
connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & PathCMDB() & "';"
connection = New OleDbConnection(connetionString)
connection.Open()
Dim cmd As OleDbCommand = New OleDbCommand(sql, connection)
cmd.CommandText = "ALTER TABLE [Machines] ADD [CNC_Folder] Text (255) NULL"
cmd.ExecuteNonQuery()
connection.Close()
connection.Dispose()
|
|
|
|
|
|
Hmm not really I am not using ADOX. I was hoping to just change the sql statement somehow. I am just using standard OleDbConnection
|
|
|
|
|
By the looks of it, it can't be done via a SQL script. If you set the column to "NOT NULL" rather than "NULL", that should allow zero-length values. Will that be feasible, or do you absolutely have to allow both NULL and zero-length?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
I have to allow both.
"So simply but yet so hard"
I guess I could always create a ADOX wrapper but I don't really want to go that way
|
|
|
|
|
May be your only option. Google it. I searched around and everything I found said that it's not possible via a SQL query script to allow NULL and zero-length.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|