|
You can set the RowFilter of the Datagrid in the ComboBox SelectedIndexChanged event.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'ur selected order no
m_orderNo = Integer.Parse(CType(ComboBox1.SelectedValue, String)
CType(DataGrid1.DataSource, DataTable).DefaultView.RowFilter = "orderno = " + m_orderNo.ToString()
End Sub
|
|
|
|
|
How cant I conect with oracle data base with VB.NET?
|
|
|
|
|
You can use the Microsoft OLEDB provider for Oracle with the System.Data.OleDb objects; you can use the Microsoft native provider for Oracle with the OracleClient objects; or you can use Oracle's own .NET provider (I haven't used it so I'm not sure its object library).
For OLEDB, you would use something like this code:
Imports System.Data.OleDb
Sub DoSomethingInOracle()
Const kConnectionString = _
"Provider=MSDAORA.1;User ID=myUser; Password=myPass;Data Source=myServer;"
Dim conn As OleDbConnection
Try
conn = New OleDbConnection(kConnectionString)
conn.Open()
...
Catch ex As Exception
...
Finally
conn.Dispose()
End Try
End Sub
|
|
|
|
|
Hi
I'm looking for a datagrid that allow add, delete and resize columns by a context menu like the datagrid in Details View of Windows Explorer.
If someone know where I could get it, It'll be very helpful.
Thanks
----
hxxbin
|
|
|
|
|
sir
i want project's sample or topic for it
|
|
|
|
|
Sorry, actually I don't have a project's sample, cuz first I wanna know if there is a component like I need.
----
hxxbin
|
|
|
|
|
you may build your own rioght click menu then add the code to tge options in your right click menu. Its not very difficult. there is tons of free source code for a right click menu...take a look on the google search engine
Greg S
|
|
|
|
|
Basically ive a homemade webbrowser with lots of security and tools. On my main form..frmWebbrowser I plaaced an SStab1. I created code(works upon user request) to add a new tab with url as its name.eg...
BrowserForm.Frame1.Visible = False
BrowserForm.SSTab1.TabCaption(0) = BrowserForm.AddressField.Text
BrowserForm.SSTab1.Tabs = 2
BrowserForm.SSTab1.TabCaption(1) = BrowserForm.AddressField.Text
no problem here....but I want to create a new browser on the new tab. This must be done at runtime. ANd help would be highly appreciated..Thanks in Advance you guys have helped a lot already!
oh..some FYI...
Also I guess there are some issues with making the browser visible...
thanks Greg S
|
|
|
|
|
I need to design a dataaccess class that will allow me to call the same stored procedures on different databases. I want the class to be static but also to take advantage of connection pooling. I guess each method will need to be passed the database connection string. I will also need a collection of connection objects that I will need to manage (one for each database). Are there any good reference articles on this that anyone could point me in the direction of. Do you need more info on what I'm trying to achieve to answer this query, if so please post back.
Jim
|
|
|
|
|
Hi Jim. Are the databases all from the same provider? (e.g. are they all accessed using either the SqlClient classes, or the OleDbClient, or some other provider?)
If they're all accessed using SqlClient classes, I would think a simple Array or ArrayList would work for holding your SqlConnection objects. Then your method for calling your stored procedure could loop through the connections array, performing the following tasks: open the connection, set up a SqlCommand object for the stored procedure, call the SqlCommand.ExecuteNonQuery() method, and finally close the connection.
|
|
|
|
|
Mike
Yes they're all SqlClient. I think I will try your method and see how well it works.
Thanks
Jim
|
|
|
|
|
If you're using an OleDbConnection for Oracle, I think you could probably use the OleDbCommand's ExecuteNonQuery() method, issuing a "Create Table ..." statement. Here's an example of a VB.NET console application doing it this way:
Imports System.Data.OleDb
Module Module1
Sub Main()
Const kConnectionString = _
"Provider=MSDAORA.1;User ID=myUser; Password=myPass;Data Source=myServer;"
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Dim strSql As String
Try
conn = New OleDbConnection(kConnectionString)
conn.Open()
strSql = "Create Table test1(field1 varchar(10))"
cmd = New OleDbCommand(strSql, conn)
cmd.ExecuteNonQuery()
Console.WriteLine("Statement executed.")
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
cmd.Dispose()
conn.Dispose()
End Try
Console.WriteLine("Press Enter...")
Dim strWait As String = Console.ReadLine()
End Sub
End Module
If you're using a different provider (like the OracleClient for example) you'll want to review that provider's documentation for the proper methods to create a table.
|
|
|
|
|
I'm using System.Web.Mail to send e-mails out via smtp using the code below:
Dim Message As System.Web.mail.MailMessage = New System.Web.Mail.MailMessage
Message.To = "someone@outside.com"
Message.From = "me@mycompany.com"
Message.Subject = "test"
Message.Body = "test"
Message.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "MY_EX" 'MY_EX = internal exchange server
SmtpMail.Send(Message)
When I send to someone within my company it works like a charm. When I send to an address outside it gives me an error:
Could not access 'CDO.Message' object.
If I change the SmtpMail.SmtpServer to "localhost" it works fine for the reverse, external but not internal addresses. This setup however doesn't create an error but the internal addresses never receive the message, only the external.
Can someone shed some light on what I'm doing wrong. Any suggestions are appreciated.
Thanks,
Kevin
Lost in the vast sea of .NET
|
|
|
|
|
Hi Kevin. Does your internal exchange server have any rules set up to prevent its use as an smtp mail relay?
One thing I've found is helpful when diagnosing the "Could not access 'CDO.Message' object" error is to look at the InnerException property of the Exception object you catch; if one is there, output its message and see if that sheds more light on the problem. If the InnerException exists, also check to see if it has its own InnerException. Keep going until you hit an InnerException = nothing. It may be there are nested exceptions, leading to the outer exception you trap as a 'CDO.Message' error.
|
|
|
|
|
I posted my question on 4 different message boards and received great feedback from all. I like to take the info I received and post the solution if possible so others might benefit if they run into the same problem.
There is a great website that was suggested and I used which gives in depth info on System.WebMail. The site is http://www.systemwebmail.net/ and I would highly recommend it to anyone with questions like the one I had.
Also, one suggestion was to look for the inner exception. I used the following code and found that my inner exception gave me much more info as to what my real problem was. My inner exception was ‘550 Relaying is prohibited’. Relaying needs to be configured correctly on our server. Without the inner exception, I wouldn’t have known this.
Try
SmtpMail.SmtpServer = "EX_SRVR"
SmtpMail.Send(Message)
Catch ex As System.Web.HttpException
strLogMsg = "Error connecting to exchange server: " ex.Message
If ex.InnerException.ToString <> Nothing Then
MsgBox("The following InnerException reported: " & ex.InnerException.ToString)
End If
End Try
Thanks again to all!!
Lost in the vast sea of .NET
|
|
|
|
|
Hi i want to access exchane server5.5 through .NET ,
Does it have some object model
please guide
P.S. PATWAL
|
|
|
|
|
I may be dumb about this, but I have been unable to find the function to raise 10x in VB script!
Anyone know the function I need?
I have looked through the MSDN and not found a reference. I would have expeceted it to be something like:
value = pow(10.0, x)
but pow does not exist.
You can tell I am a c++ coder floundering in the wonderful world of VB!
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
It's much easier than it is in C++. Just use:
result = number ^ exponent
value = 10 ^ x
RageInTheMachine9532
|
|
|
|
|
Thanks for that. I should have known it....
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Does anybody got an clue about how to program Plug-Ins for WinAmp (2.9) in VB !6.0! ??? I really need to do this but I also really don't know how...
Please help,
(¯`·._.·[eRiK]·._.·´¯)
|
|
|
|
|
Anybody know how to design the height of listview columnheaderin vb.net? all i ahd tried is only can be witdth only....hope anyone who met it n solve b4 can tel me soon....
|
|
|
|
|
Does anybody know how to get the cd name, (volume name) and to get the files list in the directory? to pass it in a dataset...
|
|
|
|
|
Hi Julien. Well, you can look at the FileInfo.Name[^] documentation for an example of getting the list of files in a directory. The Dir() function, though a carryover from VB6, is also available in the Microsoft.VisualBasic namespace.
As for the volume name, you could try this (where E:\ is your CD drive):
Dir("E:\", FileAttribute.Volume) or I suppose you could add a reference to the Microsoft Scripting Runtime in your vb.net project and use the FileSystemObject 's GetDrive() method.
|
|
|
|
|
Thanks for your help
Julien
|
|
|
|
|
Hello,
I have spent considerable time trying to find out how to execute a DOS command (something that can be run from the command prompt on a windows machine) from ASP.NET/VB.NET.
I have managed to launch a few processes on the server, but was unable to attach to them - and I had to reboot the server to kill them.
In a nutshell: I use a series of databound pages to locate a device on an intranet. From there I want the user to be able to press a button and either PING the device or TELNET to it. It is suppose to save the user time...instead of having them opening up a DOS window and typing "PING -t mydevice" I want to send the command for them - and show them the results in a standard DOS window.
Please help!
Terry
|
|
|
|