|
From the browser control?? You'd have to implement some kind of proxy server and direct the browser to use that instead of going straight out to the Internet.
This is definitely NOT a beginner level project.
|
|
|
|
|
For form elements that are posted to the page
Request.Form("formName")
to get the values from the url
Request("help")
Hope this helps.
|
|
|
|
|
Hi Experts,
I m an ABAPer, My requirement is to transfer MSAccess data to SAP Custom table (created by me) through RFC call from VB code.
All ABAP things are done but through VB i have to pass table name to my SAP RFC code. I dont understand how i can pass tablename. It does not accept recordset.
Can anyone give me any thought how this could be done in VB.
Thanks in advance.
|
|
|
|
|
Before we answer, what versio of VB are you using ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi Vuyiswa,
Thanks for ur reply.
my vb version is VB6, also i tried using ActiveX control but it did not through.
........tblOPTIONS = adodc1.recordsource
|
|
|
|
|
VB6 is Dead and should not be used anymore. Microsoft has abandoned it.
I can only help you if you are using VB.NET or C#
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
hi, iv got this prgm where i choose a file, read the data in the file, compare it with a directory whether data in that file r in that directory..
data in the file
<tarikh> <runno> <coop>
20090101 C1234 B0018
20090211 C1234 B0150
20090228 C5678 BRT10
20090228 C5678 BP001
when i debug the prgm, the error happen in convertCoop(coop) at Catch Ex As Exception.. b4 Catch part, the value of coop can be retrieve, but when i try to put values from table kodPortal to portal that is portal = ds.Tables(0).Rows(0).Item("portal"), at this part, no values are enter to portal. the error at catch is "make sure that the max index on a list is less than the list size". before this the prgm can run and come out with an output, but when i choose file that have no extension, the error come out.. after i did some editing, now any file that i choose have the same error. Pls help me... i have been posting this msg at several forum, but no one can help me..
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fdlg As OpenFileDialog = New OpenFileDialog()
fdlg.Title = "C# Corner Open File Dialog"
fdlg.InitialDirectory = "c:\"
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"
fdlg.FilterIndex = 2
fdlg.RestoreDirectory = True
If fdlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
TextBox1.Text = fdlg.FileName
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim folderopen As New FolderBrowserDialog
With folderopen
.RootFolder = Environment.SpecialFolder.Desktop
.SelectedPath = "C:\DOCUMENT"
.Description = "Select the source directory"
If .ShowDialog = Windows.Forms.DialogResult.OK Then
' Display the selected folder if the user clicked on the OK button.
MessageBox.Show(.SelectedPath)
TextBox2.Text = .SelectedPath
End If
End With
End Sub
Private Sub convertCoop(ByVal coop As String)
Dim conn1 As New SqlClient.SqlConnection("Data Source=10.0.0.70;User ID= sysadm;Password=sysadm;Initial Catalog=SPGA_Latihan;Persist Security Info=True;")
Dim comm As SqlClient.SqlDataAdapter = Nothing
Dim ds As DataSet = New DataSet()
Dim strSQL2 As String = "SELECT folder, portal FROM kodPortal WHERE folder ='" & coop & "'"
Try
conn1.Open()
comm = New SqlClient.SqlDataAdapter(strSQL2, conn1)
comm.Fill(ds, "kodPortal")
portal = ds.Tables(0).Rows(0).Item("portal")
conn1.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
If Not conn1 Is Nothing And conn1.State = ConnectionState.Open Then
conn1.Close()
End If
conn1 = Nothing
comm = Nothing
End Try
End Sub
Private Sub SEMAK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SEMAK.Click
Dim fileName As String = TextBox1.Text.Trim
Dim lineNumber As Integer = 0
Dim sr As StreamReader = New StreamReader(fileName)
Dim conn As New SqlClient.SqlConnection("Data Source=10.0.0.70;User ID= sysadm;Password=sysadm;Initial Catalog=SPGA_Latihan;Persist Security Info=True;")
Dim tarikh As String = ""
Dim runNo As String = ""
Dim coop As String = ""
Dim line As String = ""
Do
line = sr.ReadLine()
If line <> Nothing Then
Try
tarikh = line.Substring(0, 8).Trim()
runNo = line.Substring(9, 5).Trim()
coop = line.Substring(15).Trim()
Catch ex As Exception
Console.Write(ex.ToString())
End Try
Dim strSQL As String = "INSERT INTO portal (tarikh,runNo, coop) VALUES (@tarikh, @runNo, @coop)"
Dim cmd As New System.Data.SqlClient.SqlCommand(strSQL, conn)
conn.Open()
cmd.Parameters.Add(New SqlClient.SqlParameter("@tarikh", SqlDbType.Char, 8))
cmd.Parameters("@tarikh").Value = tarikh
cmd.Parameters.Add(New SqlClient.SqlParameter("@runNo", SqlDbType.Char, 20))
cmd.Parameters("@runNo").Value = runNo
cmd.Parameters.Add(New SqlClient.SqlParameter("@coop", SqlDbType.VarChar, 100))
cmd.Parameters("@coop").Value = coop
cmd.ExecuteNonQuery()
conn.Close()
Dim dirB1 As DirectoryInfo = New DirectoryInfo(TextBox2.Text)
Try
convertCoop(coop)
Dim dA1 As DirectoryInfo
Dim dirB2 As FileSystemInfo() = dirB1.GetDirectories
Dim strSQL2 As String = "SELECT folder, portal FROM kodPortal"
Dim cmd2 As New System.Data.SqlClient.SqlCommand(strSQL2, conn)
For Each dA1 In dirB2
If dA1.Name = portal Then
Dim dA2 As DirectoryInfo
Dim dirB3 As FileSystemInfo() = dA1.GetDirectories
For Each dA2 In dirB3
If dA2.Name = "Fail_Bayaran" Then
Dim dA3 As DirectoryInfo
Dim dirB4 As FileSystemInfo() = dA2.GetDirectories
For Each dA3 In dirB4
If dA3.Name = coop Then
Dim dA4 As FileSystemInfo
Dim dirB5 As FileSystemInfo() = dA3.GetFileSystemInfos
For Each dA4 In dirB5
If dA4.Name <> runNo Then
MsgBox(coop)
End If
Next dA4
End If
Next dA3
End If
Next dA2
End If
Next dA1
Catch ex As Exception
End Try
End If
Loop Until line Is Nothing
sr.Close()
End Sub
|
|
|
|
|
I've answered you plenty of times. Your code sucks. Also, no-one is going to read this much code.
Your core issues are:
1 - you read from a collection without checking first if it has objects at the index you specify
2 - this means your SQL is failing.
#2 is the issue you need to resolve. #1 is just a matter of writing production quality code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i know my code sucks bcoz this is my 2nd time doing a prgm n b4 this i dont even know how to use vb or vb.net at all. it would be great if u give me any related article regarding issues 1 n 2. as i said b4 in my previous post (not this one but the same problem) my english r not that good, so whenever i try to google my problem, i cannot find any related article to my problem. i know u dont have time to entertain my stupid question, but if u can pls give the related link. im quite confused why it run ok n suddenly it cannot bcoz i didnt do any editing on ds.table part and it can retrieve data from table b4 this.
tq
|
|
|
|
|
create a program that using a combination of selection statement (if-else if/swith-case)
and loop statement(for/while/do-while).
|
|
|
|
|
You're going to fail your class. Well, you sure deserve to, at this rate. Your project is both trivial, and vague. No-one is going to do your homework for you. If you can't work it out, talk to your teacher, look at your books, or apply for an arts course ( or cut out the middle man and get a job at McDonalds )
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: apply for an arts course ( or cut out the middle man and get a job at McDonalds )
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOLerrific.
|
|
|
|
|
Here ya go,
Do
If User = "Jieya" AndAlso AttemptedHomework Then
HasClue = True
Else
HasClue = False
Call GetJobAtMcDonalds(User)
End If
Loop Until (HasClue = True)
In your case, this would probably just be an endless loop.
Cheers
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
modified on Friday, March 20, 2009 10:03 AM
|
|
|
|
|
hello every one
i am having problem related to listview.I want to sort partivular column of listview (ascending or descending)on label mouse click event.I knew how to sort whole listview for that my code is :-
Private Sub lbl2_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lbl2.MouseClick
Try
Me.lst1.Sorting = SortOrder.Descending
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
please help.......
|
|
|
|
|
wow - are you trying to write unreadable code ? lbl2 and lst1 ?
If the list control doesn't have a property for what column to sort by, you may have to sort your data yourself and just bind to a sorted collection.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi
this lst1 are lbl2 shortform written for listview and labels....
|
|
|
|
|
Okay, you defined your sorting order, but you forgot to sort! Add the following:
Me.lst1.Sort()
|
|
|
|
|
hello
The solution you gave is true for sorting whole listview but what if i want to sort particular column of a listview....
Me.lst1.Sorting = SortOrder.Descending
the above syntax will sort whole listview...
but not particular column ...so
please help...
|
|
|
|
|
Sorting Listview columns in the .NET world is not simple. Let me see if I can give you the tools that I use for the same task. First, add this class to your project.
Imports System.Windows.Forms
Public Class C_ListviewComparer
Implements IComparer
#Region " Members "
Private _columnNumber As Integer
Private _sortOrder As SortOrder
#End Region
#Region " Constructors "
Public Sub New(ByVal ColumnNumber As Integer, _
Optional ByVal SortOrder As SortOrder = SortOrder.Ascending)
_columnNumber = ColumnNumber
_sortOrder = SortOrder
End Sub
#End Region
#Region " Methods "
#Region " ... Compare "
Public Function Compare( _
ByVal Lvi1 As Object, _
ByVal Lvi2 As Object) As Integer _
Implements System.Collections.IComparer.Compare
'-----------------------------------------------------
' Compare two subitem values in the same listview
' column
'-----------------------------------------------------
Select Case _sortOrder
Case SortOrder.Ascending ' Ascending sort order
Return CompareResult(SubitemValue(DirectCast(Lvi1, ListViewItem)), _
SubitemValue(DirectCast(Lvi2, ListViewItem)))
Case Else ' Descending sort order
Return CompareResult(SubitemValue(DirectCast(Lvi2, ListViewItem)), _
SubitemValue(DirectCast(Lvi1, ListViewItem)))
End Select
End Function
#End Region
#End Region
#Region " Procedures "
#Region " ... CompareResult "
Private Function CompareResult( _
ByVal FirstString As String, _
ByVal SecondString As String) As Integer
'-----------------------------------------------------
' Compare the subitem values to determine their sort
' order. For ascending sorts, the FirstString is the X
' value and SecondString the Y value. The values are
' reversed for a Descending sort.
'-----------------------------------------------------
If IsNumeric(FirstString) _
AndAlso IsNumeric(SecondString) Then
'** Numeric values
Return Val(FirstString).CompareTo(Val(SecondString))
ElseIf IsDate(FirstString) _
AndAlso IsDate(SecondString) Then
'** Date values
Return _
DateTime.Parse(FirstString).CompareTo(DateTime.Parse(SecondString))
Else
'** String values
Return String.Compare(FirstString, SecondString)
End If
End Function
#End Region
#Region " ... SubitemValue "
Private Function SubitemValue( _
ByVal Item As ListViewItem) As String
'-----------------------------------------------------
' Get the subitem text upon which the compare is based
'-----------------------------------------------------
Select Case Item.SubItems.Count
Case Is <= _columnNumber
Return ""
Case Else
Return Item.SubItems(_columnNumber).Text
End Select
End Function
#End Region
#End Region
End Class
With the above class in place, sorting listview columns becomes easy. For example, to sort ascending on column 3, use something like this.
Listview1.ListViewItemSorter = New C_ListviewComparer(3)
Listview1.Sort()
To sort descending on column 6, the code becomes as follows.
Listview1.ListViewItemSorter = New C_ListviewComparer(6, SortOrder.Descending)
Listview1.Sort()
To sort on two or more columns, sort the minor key first and then the major key. For example, to sort column 4 within column 3, do this.
Listview1.ListViewItemSorter = New C_ListviewComparer(4)
Listview1.Sort()
Listview1.ListViewItemSorter = New C_ListviewComparer(3)
Listview1.Sort()
I should probably write an article on this topic, but, I just submitted another one. Maybe this one will be next.
Hope this helps ... George
|
|
|
|
|
Okay so how to explain this..
For example,
when I place a panel on my child form, set its dock property to fill and set the panels back color to black.
and then display the child form (having defaulted it's WindowsState to maximized)
The Form Displays Maximized but the panel remains the initial size that it was in the designer(ask me to explain that again if I'm unclear). If I however set the WindowState to Maximized in the Form Load of the MDI Child, the Child Form will re size itself, OR RATHER the panel will re size itself to fill the rest of the space in the parent container. (but not with out displaying the panels initial size first,looks tacky)
Am I doing something wrong to cause this ?
What I actually want to do (and excuse me for putting this part 2nd) is to display the Child Forms in tabs, which works fine except for the problem mentioned above. However when using tabs setting the WindowState to Maximized in the Form Load doesn't re size the form or panel.
Here's the code im using to create the child form and add it to the tab contorl:
*****************************************************
Dim myTab As New TabPage("mMnewtab")
mytab.Name = "frmMdiChild"
Dim myChild As New frmMdiChild
myChild.Text = "wateva"
myChild.MdiParent = Me
myChild.Visible = True
'myChild.WindowState = FormWindowState.Maximized //makes no difference
mytab.Controls.Add(myChild)
myTabControl.TabPages.Add(mytab)
myTabControl.SelectedTab = mytab
*****************************************************
any help would be greatly appreciated, thanks !
|
|
|
|
|
I'm not sure what your problem is but in the resize event of the child form put this in to see if it will fix you issue.
If Me.WindowState <> FormWindowState.Minimized Then Me.Refresh()
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
It sounds like the panel's Anchor property is not set correctly. If the panel's Anchor property is set to Top, Bottom, Left, Right the panel should stretch when the window is maximized so that the distances between the edges of the panel and the edges of the form remain constant.
|
|
|
|
|
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears.
It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc.
Any idea on how to find out what's going on?
|
|
|
|
|
If it was a scheduled task, then the final exit code would be available in the scheduled task window.
|
|
|
|
|
Is there a way one can start a program, then stop it (say at midnight), and restart it again?
|
|
|
|
|