|
Is is possible to programatically determine the location of installed software? For example, when the user goes through the installation wizard of, for example, Microsoft Word - but decides to change the "default" location to one of their own choosing, can I have my VB.NET code discover where the user chose to install it to - without searching everywhere for WINWORD.EXE?
|
|
|
|
|
|
I bound several controls to columns in a dataset that was populated from a swl server table + additional connections for some comboboxes. I am adding another form to obtain a search/filter options from user. I understand to filter I need to be using a view rather than dataset.
I am confused about how to properly bind the controls to the main population, yet beable to filter to show only a subset if the user chooses. I assume I can reset on a button back to full pop. Could someone give me a brief explanation and provide some code examples? I realize this is asking much!
frmMain has textboxes and comboboxes. Most of the controls are bound like:
txtCity.DataBindings.Add(New Binding("Text", DsAppLog11.Tables(0), "City"))
txtFirstName.DataBindings.Add(New Binding("Text", DsAppLog11.Tables(0), "First_Name"))
I have navigation controls that move to next/previous record. I am trying to apply the logic introduced from the search form to filter or repopulate the data user sees on frm main. To accomplish this I was trying to switch to a view rather than dataset since I understood a fiew could be filtered or sorted and dataset could not? I tried a test binding like:
txtAppID.DataBindings.Add(New Binding("Text", dvAll, "id_num"))
When testing and stepping thru records this data was the only one that would not change with the data from next record. It would show the initial value but no change when stepping to next. I realize that the navigation is still tied to dataset and I assume that this is the reason the control does not change when th record does:
Me.BindingContext(DsAppLog11.APPT_LOGS).Position += 1
I am confused about many things but let me focus on the following:
I need to be able to apply the search logic to the data seen in frm main. When finished, on a button I need to allow the data to be switched back to the full population minus the filter. Can you give me a little directional guidance and code sample to help me along?
|
|
|
|
|
I wonder if anyone can help me. The situation is that I cannot seem to display my dataset I have created in VB.Net onto my crystal report. In the Crystal report I have inserted the database nwind.mdb and using the employees table. No matter what I do, I seem to get all the records in the Employee table. What am I doing wrong. I have attached the code I am using.
Private Sub cmdCR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCR.Click
Dim DA As OleDb.OleDbDataAdapter
Dim DS As New DataSet
Dim strSQL As String = "SELECT EmployeeID, LastName, FirstName FROM EMPLOYEES where EmployeeID = 1"
Dim strReportPath As String = "C:\Temp\report1.rpt"
Try
DA = New OleDb.OleDbDataAdapter(strSQL, sOleDbConnection)
DA.Fill(DS, "Employees")
'Load Crystal Report's rpt file
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cr.Load(strReportPath)
cr.SetDataSource(DS.Tables("Employees"))
CrystalReportViewer1.ReportSource = cr
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
|
|
|
|
|
I done the following and it seems to work. I added a paramter on the crystal report called it ABC and done the following code....
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim strReportPath As String = "C:\Temp\report1.rpt"
Try
'Load Crystal Report's rpt file
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cr.Load(strReportPath)
'Declare the parameter related objects
Dim param1Fields As New CrystalDecisions.Shared.ParameterFields
Dim param1Field As New CrystalDecisions.Shared.ParameterField
Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param1Field.ParameterFieldName = "ABC"
param1Range.Value = 3
param1Field.CurrentValues.Add(param1Range)
param1Fields.Add(param1Field)
CrystalReportViewer1.ParameterFieldInfo = param1Fields
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
CrystalReportViewer1.ReportSource = strReportPath
CrystalReportViewer1.Refresh()
'Set the CrystalReportViewer's apperance and set the ReportSource
CrystalReportViewer1.ShowRefreshButton = False
CrystalReportViewer1.ShowCloseButton = False
CrystalReportViewer1.ShowGroupTreeButton = False
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
|
|
|
|
|
i am trying to insert the data from database to mircosoft chart control but when i use the code below, the data reader read till the end of record, and how i going to store in one by one to the chart control??? Anyone can help?
Thank you.
Dim strSales(,) As String
Dim i As Integer = 0
Dim count As Integer
Dim data As String
Dim num As Integer
Dim mySelectQuery As String = "SELECT ID,sales FROM sales"
'Dim countquery As String = " SELECT COUNT(sales) FROM sales"
Dim myConnection As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DATA SOURCE=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\db2.mdb;User Id='admin';Password='';")
Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
' Dim myCommand1 As New OleDbCommand(countquery, myConnection)
myConnection.Open()
Dim myReader As OleDbDataReader
myReader = myCommand.ExecuteReader()
' Always call Read before accessing data.
' For i = 1 To 11
'
While (myReader.Read())
'(myReader.GetValue(0)) '+ ", " _
' + myReader.GetString(1))
'{{"Location", "Thousands of tons of steel"}, _
'strSales(1) = myReader.GetValue(0)
' While (i = i)
strSales = New String(,) _
{{myReader.GetString(0), myReader.GetValue(1)}}
' MessageBox.Show(myReader.GetString(0))
' MessageBox.Show(myReader.GetValue(1))
' End While
' i += 1
End While
chSales1.ChartData = strSales
' MessageBox.Show(strSales(1))
' Next i
' always call Close when done reading.
myReader.Close()
' Close the connection when done with it.
myConnection.Close()
sdasasd
|
|
|
|
|
As you've discovered, the Microsoft Chart ActiveX control is underdocumented and is not easy to use.
I recommend that you use a different Chart control and one that was built in .NET. I highly recommend ZedGraph[^]. The charts come out nicer, it's better documented, has plenty of code examples, and it's free.
|
|
|
|
|
Joshua Quick wrote: I highly recommend ZedGraph[^]
I must agree with Joshua. ZedGraph is really better to use than ActiveX.
Paul
|
|
|
|
|
In treeview I populated all the drives with their respective files and folders . Now the problem is I got stuck in attaching any file's icon or folder icon dynamically.I mean the icons are not loaded at design time . The icons of the particular file will be found at run time and then will be attached to the respective file or folder.
Please help me.
Thanks and Regards
Pankaj Garg
|
|
|
|
|
You can create an ImageList via code and assign it to TreeView.ImageList in your Form Load event handler.
Public Class MyForm : Inherits Forms.Form
Private myImageList As New ImageList
'
Private Sub MyForm_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim iconBuf As Drawing.Icon
'
' Setup ImageList.
myImageList.ColorDepth = ColorDepth.Depth32Bit
myImageList.ImageSize = New Size(16, 16)
'
' Add 16x16 icons to ImageList here.
iconBuf = Me.Icon
myImageList.Images.Add(New Drawing.Icon(iconBuf, 16, 16))
'
' Assign ImageList to TreeView.
myTreeView.ImageList = myImageList
End Sub
End Class
|
|
|
|
|
|
NEVERMIND I just pulled my head out!
|
|
|
|
|
Dear Friends
How can i use the video files in my vb6 project. I want to save some video file while saving the patient record. Then I want to run that video file in my vb form. Please help me by giving the required logic.
Your quick response will be highly appreciated.
Thankx
Murtuza Patel
-- modified at 9:08 Saturday 25th February, 2006
|
|
|
|
|
You'll have to add a MediaPlayer to the ToolBox. After that, all you do is drop one on your form. You can then tell it to play whatever file you want. I would HIGHLY suggest NOT saving the video file to the database. This will just bloat the database in a BIG way and make it more difficult to play the video. Save the video file in a folder on the server, then save the filename of the video file in the database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there, i need your help supporting arabic language in the setup deployment project by visual studio
I want to find arabic support in the setup deployment project i can't name the project using arabic name or even name the shortcut with arabic name.
I tried a trial version of InstallShield but i recognized that it doesn't support arabic language although it supports 33 languages Once i rename the project name in visual studio, i will tell me in the warning tab that an invalid non-ASCII character is used
this software will be deployed for arabic users who don't know anything about english
so i after my windows application is finished (supposed to be the biggest work to do), i can't deploy it to customers.
please i need your comments and help ASAP, or i will lose my work.
Note that i searched through the internet and till now i have no answers.
the warning is:
"Invalid Language characters in property 'Title'"
RedSpiders
|
|
|
|
|
this is my code for login but it has an error.it stuck when comes to Myconn.open().
the error is : The ConnectionString property has not been initialized.
this is the code :
Function DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer
Dim conMyData As SqlConnection
Dim cmdSelect As SqlCommand
Dim parmReturnValue As SqlParameter
Dim intResult As Integer
conMyData = New SqlConnection(ConfigurationManager.AppSettings("psmConnectionString"))
cmdSelect = New SqlCommand("sp_ValidateUser", conMyData)
cmdSelect.CommandType = CommandType.StoredProcedure
parmReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int)
parmReturnValue.Direction = ParameterDirection.Input
cmdSelect.Parameters.Add("@noPekerja", SqlDbType.VarChar)
cmdSelect.Parameters.Add("@pWord", SqlDbType.VarChar)
conMyData.Open()
cmdSelect.ExecuteNonQuery()
intResult = cmdSelect.Parameters("RETURN_VALUE").Value
conMyData.Close()
If intResult < 0 Then
If intResult = -1 Then
lblMessage.Text = "Username Not Registered!"
Else
lblMessage.Text = "Invalid Password!"
End If
End If
End Function
pliz anybody can help me.
|
|
|
|
|
pandapatin wrote: ConfigurationManager.AppSettings("psmConnectionString")
This is not returning a value because the config file is not set up properly.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
i am working with vb .net, in my project i have to merge
six pdf files to a single pdf file, can u suggest a
method using vb.net, pls...
|
|
|
|
|
|
I am trying to generate a message that will be displayed when I open my computer. I should be checking the system date every day.
Please help
|
|
|
|
|
NOKO1 wrote: when I open my computer
When?? Are you saying that you want this to show up when you logon?
All you do is create your app and drop a shortcut to your .EXE in the Startup folder (C:\Documents and Settings\user\StartMenu\Programs\Startup).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I trying to make a gaunt chart, I have added this dll file to the Resources but when I click on it, it is not displayed in the toolbox. I am using Visual Basic Express Edition.
|
|
|
|
|
Get that .DLL out of your resources, it's useless there.
You have to right-click the Toolbox, then pick Add/Remove Items... Either find your .DLL in the .NET Components or COM Components tab, or you can click browse to locate your .DLL file. If it's of the correct type, you'll get your icon in the Toolbox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I use access 2000 in my Point of sales applications but my problem is that the database keeps growing and growing, I need to use another type of database, what do u suggestthan ks alot
ps:I can't use MSSQL becuase it needs space on the PC
RJ
-- modified at 4:05 Saturday 25th February, 2006
|
|
|
|
|
rawanrawan wrote: I need to use another type of database, what do u suggest
Depends really on how big the db is going to get. My suggestion would be Microsoft SQL Server or MySQL (if you are on a budget). Microsoft SQL Server will scale very nicely.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
-- modified at 4:04 Saturday 25th February, 2006
|
|
|
|