|
Hi,
1.
please use PRE tags instead of CODE tags to make things readable.
You can still edit your original message...
2.
I doubt Dim i As New ListViewItem(ind) is correct.
Try Dim i As New ListViewItem()
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
ok i will use.
but in the data base the colunn idGrupo is "Lab1" for exemple not number.
in group the items are inserted correctly but foe members no, why ?
the problem is when the code are debugin only get one member "the first"
is because i'm searching for string at database for example "Lab1" in colunn "idGrupo" ?
i don't know why he get only the first provabily the code is wrong ^^"
|
|
|
|
|
I think this line is the culprit
If item.Selected = True Then
Remove this If condition and try again.
|
|
|
|
|
i'm used other code to resolve this problem .
i'll post where for know how code i used.
Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
lstestacoes.Clear()
lstestacoes.View = View.LargeIcon
Try
If con.State = ConnectionState.Open Then con.Close()
lstestacoes.Clear()
lstestacoes.View = View.LargeIcon
Dim ind As Integer
Dim temp As String
For Each item As ListViewItem In ListView1.SelectedItems
If item.Selected = True Then
temp = item.SubItems(0).Text
Dim adptr As New OleDbDataAdapter("select * from Estacao WHERE Grupo= '" & temp & "'", con)
Dim ds As New DataSet
Dim dr As DataRow
Dim dt As New DataTable
Dim imageListSmall As New ImageList()
Dim imageListLarge As New ImageList()
Dim grupoquant As Integer
Try
adptr.Fill(ds, "Grupo")
dt = ds.Tables(0)
For Each dr In dt.Rows
ind = ind + 1
Dim i As New ListViewItem(ind)
i.Text = dr.Item("Nome")
i.ImageIndex = 0
lstestacoes.Items.AddRange(New ListViewItem() {i})
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
end sub
|
|
|
|
|
Dear Sir
I have many forms in my vb.net projects
I have to write(copy) all connection codes to connect DB for each form
Is any better way???? for example a class or a dll to help me ????
Generally I want another method (class or dll file) to call for loading of my forms...
Sorry about my bad english...
Thanks
|
|
|
|
|
yu can create a class with this code:
Public con As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & My.Settings.dbBase.ToString & ";Jet OLEDB:Database Password=" & My.Settings.dbBasePass.ToString & ";")
where i use a settings option to store the informations converted to string :
data base : My.Settings.dbBase.ToString
password : My.Settings.dbBasePass.ToString
i hope help you ^^
my english is not good too ^^"
|
|
|
|
|
Standard object orientated multitier design patterns help here. Been around for years.
You need to abstract all your dataAccess code (creating the connection, calling SQL etc.) into a separate DataAccess class. Then from any form in the application just call your dataaccess class.
MSDN tutorial 1: Creating a Data Access Layer[^] should give you a good start point.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
I should add that althought the MSDN articl I posted about is for ASP.Net Web Applications the DataAccess logic and code is identical for Windows Forms applications.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hi,
I am using below code to call webservice from .aspx page through javascript on my server(window 2003). i am facing Permission denied error while calling below code from client machine. can anybody help me out. tanx in advance.This application is working fine on local.
function XmlhttpCall(objXML,serviceName)
{
try
{
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var xmlHttpGo = xmlHttp;
var str = "http://192.168.0.1/mywebservice/MathWerService.asmx+serviceName;
//note = ip address is the ip address of server.
//service name is the name of service use in webservice
xmlHttpGo.open("POST", str, false);
xmlHttpGo.SetRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttpGo.send('xmlLogin=' + objXML.xml);
var xmlString1 = xmlHttpGo.responseXML.text;
return xmlString1;
}
catch(e)
{
return (e.Message + "--> XmlhttpCall");
}
}
Prabhat
no comment
|
|
|
|
|
i want to develop a windows application which work online and connect with remote sql/oracle database server through tcp/ip sockets in .net.
Avneesh Sharma
Software Developer : INFO International
City-Rishikesh-249201
Dist.-Dehradun
State-Uttarakhand
India
|
|
|
|
|
Just about every beginners book covers this.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for this information.
i know socket connection but my problem is how can i connect database through internet connection.
Avneesh Sharma
Software Developer : INFO International
City-Rishikesh-249201
Dist.-Dehradun
State-Uttarakhand
India
|
|
|
|
|
In your code, it's no different than if the database server was sitting right next to you.
You have to know how to configure your network and the network the server is sitting in in order to do this. Since there are sooooo many options, services and devices that can be between your client machine and the server, it's pretty much impossible to tell you what you have to do to set this up.
|
|
|
|
|
i'm trying some tutorials about .net remoting. in my machine the framework v1.0.3705,v1.1.4322,v2.0.50727,v3.0 and v3.5 are available.but the problem is only v2.0.50727
contains the config folder and it contains the machine.config file. in that file also the channel tag is not there, any one know why?
|
|
|
|
|
I haven't had the need to do it for a while, but I need to generate help docs from the XML comments in the source code. I've used NDoc in the past but I see that it hasn't been updated since 2005. Anyone have recommendations for alternatives?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Sandcastle for .NET 2 onwards, or Doxygen.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks. I forgotten about Sandcastle.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
No bother mate. Glad to help
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I would like to find a starting point to write a .NET application that looks like Develeoper Studio itself. Dockable Windows for stdout,stderr, tree views, ribbon bars etc.
Is there such? Preferably something in WPF, describable in XAML.
--
Christoph
|
|
|
|
|
Krischu wrote: Is there such? Preferably something in WPF
Yes, Visual Studio 2010
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
To create an app with dockable windows and ribbons you will need a good controls suite with those tools, available from companies such as divelements[^], Infragistics[^], dotnetmagic[^]. And no doubt many more can be found via google[^].
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Find out how SharpDevelop is built.
|
|
|
|
|
I have already devloped a MLM website in asp 3.0.Its Become slow gradually with increasing records in database.
>After 7000 records in database,when we generate account report.its is not generating.
>for that reason i planning to redesign in asp.net.
>But i am confused what database technic i have to use so that it become faster
|
|
|
|
|
Use SQL Server 2008 or Oracle 11g.
There are other factors that determine speed, like the structure of the database, indexes on your tables, the code you write to retrieve data, etc.
|
|
|
|
|
Does anybody have an example on how to cascade 3 combo boxes together in vb.net
Thanks
SteveH
|
|
|
|