|
I want to display remote log files through a vb.net 1.1 winform app. As these files will be coming across the wire, I want to optimize the retrieval. I believe seeking and reading the "new portion" since the last refresh will help. In testing this theory, I immediately noticed that I have another problem: displaying 190,000 lines in a textbox (txt.Text = LargeDataString) takes about 16 seconds, which seems a bit slow. In fact, adding just one line to that textbox takes an additional 16 seconds (txt.Text = txt.Text + vbcrlf + "additional line". Adding 190,000 entries to a listview: disaster! Forget it!
I had hoped to support indivual columns, but at this point I can live with a text box-like control if I can find one that's faster. Does anyone have any recommendations? Perhaps a virtual grid or something? Is there a free virtual grid out there? I don't think the data grid out of the box supports that.
Thanks.
|
|
|
|
|
I'm thying to find a range between two times. if the system time is within this time then error. Can any one help me in the coding to find the range?
silver-gray
|
|
|
|
|
|
I am having difficulty getting the underlying SQL data to update when a change is made to the datagrid. The change is made using a combobox, and allows the proper selection of 1 of the 3 choices, but I can't seem to get the syntax/code right to update the table. Here is my current code:
Public Sub comboControl_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles comboControl.SelectedValueChanged
grdVW_AllOpen(hitTestGrid.Row, hitTestGrid.Column) = comboControl.Text
Dim sc1 As New SqlCommand
Dim sCnnStr As String
sCnnStr = "Data Source=" & SQL_SERVER & ";Initial Catalog=" & DATABASE & ";User id=" & USER_ID & ";Password=" & PWD
Dim sqlConn As New SqlConnection(sCnnStr)
sc1.Connection = sqlConn
sc1.CommandType = CommandType.Text
sc1.CommandText = "UPDATE dbo.Chits_Backup SET Status = '" & comboControl.Text & "'" & ", LastName = @LastName, FirstName = @FirstName, DateofRequest = @DateofRequest, FromDate = @FromDate, ToDate = @ToDate, Days = @Days, NatureofRequest = @NatureofRequest WHERE ID = @ID"
Dim cmd As New SqlClient.SqlCommand(sc1.CommandText)
'Create the sql command object and set its command type to execute the sql query to get the results
sc1.Parameters.Add("@Status", SqlDbType.NVarChar, 50, "Status").Value = comboControl.Text
sc1.Parameters.Add("@LastName", SqlDbType.NVarChar, 50, "LastName").Value = "@LastName"
sc1.Parameters.Add("@FirstName", SqlDbType.NVarChar, 50, "FirstName").Value = "@FirstName"
sc1.Parameters.Add("@DateofRequest", SqlDbType.NVarChar, 50, "DateofRequest").Value = "@DateofRequest"
sc1.Parameters.Add("@FromDate", SqlDbType.DateTime, 8, "FromDate").Value = "@FromDate"
sc1.Parameters.Add("@ToDate", SqlDbType.DateTime, 8, "ToDate").Value = "@ToDate"
sc1.Parameters.Add("@Days", SqlDbType.NVarChar, 50, "Days").Value = "@Days"
sc1.Parameters.Add("@NatureofRequest", SqlDbType.NVarChar, 50, "NatureofRequest").Value = "@NatureofRequest"
Dim myParm2 As SqlParameter = sc1.Parameters.Add("@ID", SqlDbType.Int, 4, "ID")
myParm2.SourceVersion = DataRowVersion.Original
sqlConn.Open()
Try
sc1.ExecuteNonQuery()
Catch ex As SqlException
MsgBox(ex.Message().ToString())
End Try
sqlConn.Close()
I know it has to do with the handling of variables, but can't narrow it down.
Thank you,
LWhite
LWhite
|
|
|
|
|
could anyone help me using which method i've to access a database in other system in the network.?
My project is Seat allocation in a movie theatre.i like to inform you that this is not an online reservation. There will be five systems(LAN) in which the application will be installed and a database will reside on any one of the system. The database will be placed in anyone could anyone of these five systems. so that the application has to access the database in the other system which is in network.
could anyone help me with a suitable method ?
and also give me suggestions about this project if u have.
Hariram
-- modified at 12:54 Wednesday 20th September, 2006
|
|
|
|
|
Sounds to me like you need to configure ODBC on these machines to use the networked database. You place the database in a shared location and map the connection string to it.
Is that what you are looking for or do you need more detail. You can search MSDN for ODBC database connections and there is a ton of sample code!
cheers~
David
You are only as good as your last project.
|
|
|
|
|
An Access database is file-based. This means that whichever machine is going to host the database, it will have to Share a folder that contains the database so the other machines can get at it, usually by mapping a drive letter to the share on the server machine.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks you very much for yoursolution sir...
|
|
|
|
|
you can create a dll which can read your own type of file or a common data base sort of and store information about different servers and the connection paramaters
Belive me it works i have connected different types of forms through different databases with one common file as a connection manager.
You can even store information based on the user's accessibility and needs dynamically
|
|
|
|
|
Thanks you very much for your solution sir...
But i cant understand clearly. could you elaborate detaily(if you dont mind)...
Hariram
|
|
|
|
|
how do I assign a the columns of my datatable to a variable.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
They already are a variable, there's a columns collection on the datatable.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm always trying to improve my code. In past programs, using VS 2003 when I had a windows form application with a button setup to allow the client access to a website, I would code the click event with the following:
System.Diagnostics.Process.Start("http://www.somewebsite.com")
This code works fine, but now I'm using VS 2005 and there has to be a better more efficient way of rewriting this code.
Any help is appreciated.
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: This code works fine, but now I'm using VS 2005 and there has to be a better more efficient way of rewriting this code.
Why?
Under 2005, it's exactly the same code. There is no alternative thats "better".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wasn't sure. I know that it used to take a long section of code to try and get the computer name and now all you need to do in VS 2005 is type my.computer.name
I wasn't sure if there was an alternative in VS 2005 to the Start code.
Thanks!
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: I know that it used to take a long section of code to try and get the computer name
Huh? What "long section of code"? In previous versions of the .NET Framework, all you had to do was use Environment.MachineName to get that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ok, you're right... I used a bad example.
I guess my question is:
Is my.computer.name any more efficient or better to use over system.environment.machinename?
Microsoft gives you 10 different ways to do the same task, but my question is always which way is more efficient?
When they come out with a new version, I always try to use the new functionality if possible and try not to stay stuck using the same old code when there is simpler code to use.
Thanks for your help
Lost in the vast sea of .NET
|
|
|
|
|
The My namespace doesn't replace anything or make anything more efficient. All it is is a bunch of classes written as shortcuts, or pre-written code, to do common tasks.
Want to see the code behind My.Computer.Name ?
Computer is a class that appears to sit in the My namespace, but is actually under Microsoft.VisualBasic.Devices . It is a class that inherits from the ServerComputer class that sits in the same namespace. Here's the code, in partial class form:
Namespace Microsoft.VisualBasic.Devices
Public Class Computer
Inherits Microsoft.VisualBasic.Devices.ServerComputer
...
... ' more code specific to the Computer class
...
End Class
Public Class ServerComputer
Public Sub New()
End Sub
Public ReadOnly Property Name() As String
Get
Return Environment.MachineName
End Get
End Property
... ' More methods and properties for ServerComputer ...
End Class
End Namespace
The entire My namespace is stuff like this. In fact, I think the entire My namespace sits in various namespaces under the Microsoft.VisualBasic namespace.
If want to explore this stuff yourself, just Google for ".NET Reflector" and download it (it's free!). Then you can explore all the code in the .NET Framework and see how things are done!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I suspect some thing is messed up with the .NET 1.1 and so i want to reinstall that
The reason i came to that conclusion is that a .NET application i wrote previously which was working previously well is now generating an error
"Application has generated an exception that could not be handled process id = .... Thread id = .... "
The same application works perfectly on my computer and i know that it worked perfectly two days before too on one of our customer computer and some thing was done on that server afterwards.
Well i want to know if there is an easy way to remove it and reinstall it its on windows 2003 server. It does not show up in Add Remove Programs. When i just run dotnetfx.exe(redistributable package) it says its already there.
|
|
|
|
|
I am trying to use the built-in .NET Binding Navigator and am having some issues. I use a dataset for the Binding Source's Data Source and when I fire the program the icons on the navigator are disabled. The count also says only 1 when there are 3 records in the DB. This part of the project is just displaying user details that are retrieved from a Sql Server DB. Let me know if this is too general of a description.
UPDATE:
I am now having a problem connecting to the DB, getting a SQLException Unhandled : 'login failed for user (user)' . The connection string it uses is the same as another currently working DataAdapter. I can preview the data from the TableAdapter so I know the connection is working. Any ideas?
TIA
Big Pimpin, Spendin Gs
Nate Lindley, .NET Aficionado
|
|
|
|
|
I am a amateur programmer.just to jumbed into the pool only with interest.I have experience in database progrmming in mysql and vb6.I have no formal software education as I am a Government officer.
so please help
how can i connect MYSQL DATABASE TO VB.NET 2005.
I USE THE FOLLOWING CODE IN VB6
Public cnn as new ADODB.CONNECTION
Public str as string
sub main()
str= "Provider=MSDASQL.1;Persist Security Info=False;Data Source=revive"
cnn.connectionstring=str
cnn.open
This will connect mysql database to vb6
Pleae help me
with regards
JOSEPH
|
|
|
|
|
Try checking this[^] site out.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Can any body tell me how to get a server ip address in a textbox.
I have sqlserver 2000 in my lan and i am using vb.net 2003.
Please help me
|
|
|
|
|
Hi programmers,
i get the cannot connect to smtp server error when i try to send mail through mail from my vb application.
i used aspsmartmail componet for this.
the mails goes correctly when i use normal outlook express or my domain account through internet explorer but gives error when i send it through my code.
i am giving the code snippet which sends mails. sorry i cant give full details of my mail server and email account in code snippet plz consider for this.
plz help me guys.
Dim mySmartMail As aspSmartMail.SmartMail<br />
Set mySmartMail = New aspSmartMail.SmartMail<br />
<br />
mySmartMail.Server = "ip address of mail server"<br />
mySmartMail.ServerTimeOut = 35<br />
mySmartMail.UserName = "username"<br />
mySmartMail.Password = "password"<br />
<br />
mySmartMail.SenderAddress = "test@mydomain.com" <br />
<br />
<br />
mySmartMail.Recipients.Add "nitin@mydomain.com"<br />
<br />
mySmartMail.Subject = "my mail"<br />
mySmartMail.Body = "body"<br />
<br />
mySmartMail.SendMail<br />
<br />
Set mySmartMail = Nothing<br />
<br />
Help!
Nitin...
|
|
|
|
|
Well, you'll most likely have to get with the people that wrote that component. If you purchased it, then you have at least 1 FREE support incident, otherwise it's $159/incident.
If the IP works in Outlook, the exact same server name/IP should work in this component. If it's not, there might be some setting in this component that you have to set, but have so far failed to do so. I have no idea what that would be, since I've never used this component.
Another possibility is that you have the free version and it expires. If so, then you'll have to shovel out the money to get the full version.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|