|
Depending on where your report is stored relative to your app's .EXE file, you might want to start with something like this:
Dim appPath As String = Application.StartupPath
Dim reportPath As String = Path.Combine(appPath, "somereport.rpt")
' Load your report from the path in "reportPath".
|
|
|
|
|
sorry sir
but i cannot find any forum for vb6.0 here...
plz suggest some remedy for my problem...
how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.)
ex.
strsql="update table set fld1='" & txt1 & "', _
fld2='" & txt2 & "' where id='" & myId & "'"
this gives me the error "end of statement expected...."
plz give me the exact syntax....
|
|
|
|
|
I think the _ needs to be the last character. You can't just put & at the end ? Wow - VB6 really sucks...
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
MissionSuccess wrote: how to use the line continuation character in vb6.0 when u r going to write a update query in a string which goes more than 1024 characters(max allowed.)
ex.
strsql="update table set fld1='" & txt1 & "', _
fld2='" & txt2 & "' where id='" & myId & "'"
Probably better to split into two Update queries...
|
|
|
|
|
Hello,
You need to use the following code syntax.
strsql = "update table set fld1='" & txt1 & _<br />
"' fld2='" & txt2 & "' where id='" & myId & "'"
I hope this helps.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
You might want to read this[^] article and convert this to a parameterized query. Any user can screw this statement up just by entering a "'" character into one of your textboxes that you blindly throw into your SQL statement.
|
|
|
|
|
Hi,
I have 60 checkboxes on a form inside a split container.
I need to check the ckeck state of those checkboxes and writethe checkstate in array
I tried with the following code:
For Each grp As Control In Me.Controls
If TypeOf grp Is SplitContainer Then
For Each chk As Control In grp.Controls
If TypeOf chk Is CheckBox Then
If DirectCast(chk, CheckBox).Checked = True Then
timeSpaceArray(i) = 1
i += i
ElseIf DirectCast(chk, CheckBox).Checked = False Then
timeSpaceArray(i) = 0
i += i
End If
End If
Next
End If
Next
but it doesn't work i get all zeros in the array.
Any help greatly appreciated
thanks
|
|
|
|
|
unix_master01 wrote: i += i
surely you want to increment by 1 ? Have you bothered trying to step through this ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Have you tried stepping through the code line by line to what what's it doing?? What value does i get to?? Do the grp and chk enumerations return all the controls you expect?? Probably not.
|
|
|
|
|
how to change fore color of a cell in datagrid control at runtime. i want to change the cell color depending on a value entered in another textbox.
Thanks & Regards
|
|
|
|
|
Get that Cell and set Fore Color.
Or something other ?
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Parwej Ahamad wrote: Get that Cell
i am a bigginer in vb.net , i dont understand what u told. will u give me a sample code for that ?
Thanks & Regards
|
|
|
|
|
Grid1.Rows(1).Cells(1).ForeColor = Color.Blue
or
Me.Grid1.Rows(1).Cells.Item(1).Style.ForeColor = Color.Blue
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
is this method applicable on visual studio 2003 ?
Thanks & Regards
|
|
|
|
|
|
For everyone still using the old DataGrid in 2002/2003, I highly recommend bookmarking this FAQ[^]. It's indispensible, explaining how to do about a 100 different things with the old DataGrid.
|
|
|
|
|
Hi
How Change Properties (Such as Top and Left) controls in rpt file(Crystell Report) at runtime by vb.net?
Plz help me.
Thanks
|
|
|
|
|
hi
i just wanted to ask u how can i solve the exception error "couldnot find installable ISAM"
this exception occurs when i run this code :Dim excelConnection As System.Data.OleDb.OleDbConnection = New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:/test.xls;Extended Properties=Excel 8.0;")
excelConnection.Open()
Dim excelCommand As New System.Data.oledb.OleDbCommand("INSERT
INTO [OBDC; Driver={SQL
Server};Server=(local);Database=FullDate;Trusted_C onnection=yes].[Population]
SELECT * FROM [Population$];", excelConnection)
'Dim ExcelCommand As New System.Data.OleDb.OleDbCommand("SELECT
INTO [ODBC;Driver={SQL
Server};Server=(local);Database=FullDate;Trusted_C onnectionÂ*=yes].[Population] FROM [Population$];", excelConnection)
excelCommand.ExecuteNonQuery()
excelConnection.Close().
ALSO i wanted to ask how can i map importing data from the excel sheet to SQL with the primary key. Can anyone give me a syntax
10x in advance
|
|
|
|
|
Is Excel installed on the machine ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes of course excel is installed of my machine,may be the problem with dll files,i dont know.
|
|
|
|
|
Try enclosing the 'Excel 8.0;' in single quotes
The error occurs when accessing extended properties in the JET engine. Google your error message for heaps of info.
The Fanatical All Black Supporter - Kea Kaha
|
|
|
|
|
i want to send the right click sub routine that i've formulated, through send message funtion to windows in vb.net so that it can work same as normal right click does what i am doing is
Public Sub RightClick()
RightDown()
RightUp()
End Sub
Public Sub RightDown()
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
End Sub
Public Sub RightUp()
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
End Sub
Public Sub ClickButton(ByVal ButtonHandle As IntPtr)
'send the right mouse button "down" message to the button...
Call SendMessage(ButtonHandle, MOUSEEVENTF_RIGHTDOWN, 0, IntPtr.Zero)
'send the right mouse button "up" message to the button...
Call SendMessage(ButtonHandle, MOUSEEVENTF_RIGHTUP, 0, IntPtr.Zero)
'send the button state message to the button, telling it to handle its events...
Call SendMessage(ButtonHandle, BM_SETSTATE, 1, IntPtr.Zero)
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
RightClick()
ClickButton(Windows.Forms.MouseButtons.Right)
'MessageBox.Show("show")
End Sub
please help me where i am going wrong
farah
|
|
|
|
|
farah mazhar wrote: i want to send the right click sub routine that i've formulated, through send message funtion to windows in vb.net so that it can work same as normal right click does what i am doing is
This doesn't make any sense at all. Are you trying to send a right-click to a control in your app?? Or are you trying to send a right-click to another application's window??
Your other problem is that you copied and pasted this code from another website without understanding what it's doing. I'm willing to be that you have the Declares statements wrong because the code on the other site is written for VB6 and you're using VB.NET. Since there are big differences between the data types with the same names in the two languages, most notably the Long type, the code is not going to work in VB.NET without some conversion.
|
|
|
|
|
this is my code:
Imports System.IO<br />
Imports System.Collections<br />
Imports SHDocVw<br />
<br />
Public Class Form1<br />
<br />
Private browser As SHDocVw.InternetExplorer<br />
Private WithEvents shellWindows As SHDocVw.ShellWindows<br />
Private Current_IE_Handles As ArrayList<br />
<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
'InitializeComponent()<br />
Current_IE_Handles = New ArrayList<br />
<br />
shellWindows = New SHDocVw.ShellWindows<br />
<br />
End Sub<br />
<br />
Private Sub shellWindows_WindowRegistered1(ByVal lCookie As Integer) Handles shellWindows.WindowRegistered<br />
Dim filnam As String<br />
Dim ie As SHDocVw.InternetExplorer<br />
<br />
For Each ie In shellWindows<br />
filnam = Path.GetFileNameWithoutExtension(ie.FullName).ToLower()<br />
If filnam.Equals("iexplore") Then<br />
browser = ie<br />
End If<br />
<br />
Dim check As Boolean = True<br />
Dim i As Integer<br />
<br />
If Current_IE_Handles.Count > 0 Then<br />
For i = 0 To Current_IE_Handles.Count - 1<br />
If Current_IE_Handles(i).ToString.Equals(browser.HWND.ToString) Then<br />
check = False<br />
End If<br />
Next<br />
End If<br />
<br />
If check = True Then<br />
<br />
Me.Current_IE_Handles.Add(browser.HWND.ToString())<br />
'ListBox1.Items.Add(browser.HWND.ToString())<br />
MsgBox(browser.HWND.ToString())<br />
<br />
End If<br />
Next<br />
End Sub<br />
End Class
This code is to view all the current open IE handles.
the problem occur when de comment the 'ListBox1.Items.Add(browser.HWND.ToString())'. If I have got 3 IE open, I can only
get one handle. Does anyone know why 'Listbox1.Items.Add(browser.HWND.ToString())' stop my code keep running?
Help+
|
|
|
|
|
I can't tell what this code is doing because of the judicious use of "global" variables. Your logic needs to some work as this is just too much code for an event handler that has nothing to do with handling the WindowRegistered event. You're probably wondering why I just said that.
Easy. This code doesn't belong in an event handler. It belongs in it's own Sub or Function, and at quick glance, could be broken into 2 or 3 other subs/functions. Though, from your description of what it should be doing, this is too much code just to show a list of window handles.
This code is executing a large block of code when an event fires. It's not doing anything with the event or the data itself. The event is just being treated as a trigger to execute some code. A simple timer would do the exact same thing.
Normally, you'd take the data coming in from an event argument and setup a call to a method that takes the data, validates it, the processes it.
Private Sub shellWindows_WindowRegistered(ByVal lCookie As Integer) Handles shellWindows.WindowRegistered
UpdateWindowHandleListBox()
End Sub
Private Sub UpdateWindowHandleListBox()
ListBox1.Items.Clear()
' I have no idea what "shellWindows" is here:
For Each ie As SHDocVw.InternetExplorer In shellWindows
If Path.GetFileNameWithoutExtension(ie.FullName).ToLower().Equals("iexplore") Then
ListBox1.Items.Add(browser.HWND.ToString())
End If
Next
End Sub
Like I said, I have no idea what these other "global" variables are, what types they are, what you're using them for, WHY you're using them, ... So this code is going to be very simple compared to what you've shown.
|
|
|
|