lolafuertes 145 Master Poster

Please try

dr = cmd.ExecuteReader
if dr.HasRows() then
    While dr.Read()
        If cbPartylist.Text = (dr("PartylistName").ToString())Then
            cbPres.Items.Add (dr("Lname") & ", " & dr("Fname") & " " & dr("MI").ToString())
        End If
    End While
Else
    MsgBox "Nothing to show"
End If

And let us know the result.

Hope this helps

lolafuertes 145 Master Poster

Assuming there is one record to show, the

If objDataReader.Read = 0 Then
         
End If

will read the first record returned; then

While objDataReader.Read

will try to read the second one, but only one exist so the condition is currently false and nothing filled in the listview.

I will suggest the following code

If objDataReader.HasRows() Then
    Try              
        lvwSearch.Items.Clear()
        While objDataReader.Read
            Dim lv As New ListViewItem
            With lv
               .Text = objDataReader.Item("accountNumber")                    
               .SubItems.Add(objDataReader("division"))
               .SubItems.Add(objDataReader("Assignee"))
               .SubItems.Add(objDataReader("phoneUnitModel"))
               .SubItems.Add(objDataReader("handPhoneNumber"))
            End With
            lvwSearch.Items.Add(lv)
        End While
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
    myConnection.Close()
End If

Hope this helps

lolafuertes 145 Master Poster

The dr has rows?

lolafuertes 145 Master Poster

Plase, be so kind to try

dr = cmd.ExecuteReader
While dr.Read()
    If cbPartylist.Text = (dr("PartylistName").ToString())Then
        cbPres.Items.Add dr("Lname") & ", " & dr("Fname") & " " & dr("MI").ToString())
    End If
End While

Hope this helps

Unhnd_Exception commented: Solved +8
lolafuertes 145 Master Poster

The listbox selected item is always an object.

You can use the TypeOf operator to verify if it is a FileInfo or a DirectoryInfo class object, then act according.

Hope this helps

lolafuertes 145 Master Poster

After you create the objGraphics object, maybe you need to fill it with som content.

An example from Jayman in dreamincode.com:

Dim bmp As New Bitmap("bitmap filename")

Dim gr As Graphics = Graphics.FromImage(bmp)

Dim p1 As New Pen(Color.Blue)

gr.DrawLine(p1, x1, y1, x2, y2)

Dim bmp As New Bitmap(width, height, gr)

bmp.Save("bitmap filename")

Hope this helps

lolafuertes 145 Master Poster

I would suggest the following:

When loading the tree view, add the relevant info to find the right record to update (if changed) like the record primary key (or even the full record), into the tag property of the node.

When the node is changed, you can use the info stored on the tag property to cread a command against the database connection, to update the info in the database, and then execute this command.

Hope this helps.

lolafuertes 145 Master Poster

Maybe the magic can be to create a new module with a Sub Main and use this sub for starting the project in the project properties page.

This sub can do the following:

* Instantiate a new titleForm.
* Show the titleform.
* Do the progress bar movement for the titleForm
* instantiate the logonForm
* Close the titleForm
* Show in dialog mode the logonForm.

Hope this helps

codeorder commented: just because you seem to deserve more rep. points for all the help provided on this forum. :) +10
lolafuertes 145 Master Poster

I am unsure about the type of your feeds and feedz.
If this is an array, list or collection, there should be a Count or Length that defines how many selected descendants you got on each.

You can obtain the right property debuging the feeds. Use this to cicle over.

Comments to your code: the foreach structure will cicle over all existing elements in an array, list or collection, starting at the first. If you put a break after doing the first assignement, the next time you start the foreach, will start over the first element again, and this will produce the duplicates.

Hope this helps

lolafuertes 145 Master Poster

It seems that the compiler returns an integer as a bitwise operation.

I found nothing stating that the return value should be an integer, but all the examples I found are integer based :(

Also I found that I never used bitwise operations on other types than integer.

Sincerely.

lolafuertes 145 Master Poster

Please be so kind to post what you have written so far to try to detect where the problem is.

Sincerely

lolafuertes 145 Master Poster

Every drive has a root folder know as "\".
So starting at drive letter to search and root dir (IE: "F:\") you can use this to obtain a System.IO.DirectoryInfo

var RootDir = new System.IO.DirectoryInfo("F:\\")

Just be aware that you need to specify a doube backslash in order to be interpreted a s a single one.

At this point the root dir directoy info has a very useful function EnumerateFiles that, with the second parameter SearchOption.AllDirectories will do the trick.

Hope this helps.

ChrisHunter commented: Always a great help +1
lolafuertes 145 Master Poster

Then I'll go back to my first answer.

Lets the Form1 to be:

PropertyGrid propertyGrid1;
      public Form1()
        {
            InitializeComponent();

            propertyGrid1 = new PropertyGrid();
            propertyGrid1.Location = new Point(10, 10);
            propertyGrid1.Size = new Size(250, 400);
            this.Controls.Add(propertyGrid1);

        }

Then, where you will need to set the SelectedObject, write some code like like:

If (propertyGrid1.SelectedObject==null){
      propertyGrid1.SelectedObject = ObjectOfClassA;}
else{
      propertyGrid1 = new PropertyGrid();
      propertyGrid1.Location = new Point(10, 10);
      propertyGrid1.Size = new Size(250, 400);
      propertyGrid1.SelectedObject = ObjectOfClassA_orB_orWhatElse;}

Hope this helps

ChrisHunter commented: Has been extremely helpfull and happy to help. +1
lolafuertes 145 Master Poster

Use the SelectedItemChanged on the combo to cath the new selection. Then modify the Unit cost according.

Hope this helps

lolafuertes 145 Master Poster

The difference, in the tests i did, is that the ConfigurationSettings.AppSettings is always returning an empty array (??), so it is currently compiling without error, but not working to me (VS2010 .NET 4.0).

Hope this helps.

lolafuertes 145 Master Poster

You can start here, here (5 articles) orhere for basic concepts and examples.

Hope this helps

lolafuertes 145 Master Poster

You are using an obsolete deprecated method to retrieve the application settings.
I would prefer to use

SqlConnection con = new SqlConnection(System.Properties.Settings.Default.radicalGuard);

Hope this helps

AngelicOne commented: thanks +1
lolafuertes 145 Master Poster

Instead of selected index, you need to use the selected item, and in the from clause of the select statement, you should remove the apostrophes.

Ie:

var tableName = comboBox1.SelectedItem as string;
string str1 = "select * from " + tablename;

and in the ad.Fill(ds1) the can try

ad.Fill(ds1, tableName)

Hope this helps

lolafuertes 145 Master Poster

IMO, before ad.Fill(ds3, "sccl_et"); you need to empty the table with ds3.Tabres[0].Clear; Hope this helps

lolafuertes 145 Master Poster

Yes, you can:

MydataGridView = null;
MyDataGridView = new DataGridView();

Hope this helps

Mr.BunyRabit commented: Gave the code, and it worked +1
lolafuertes 145 Master Poster

This is because the transaction for cmdID1 and cmdID2 has not been set.

I'll suggest that as you assign the transaction to the sqlcmd in line 3 of this example, you should add in line 4:

cmdID1.Transaction = trans
cmdID2.Transaction = trans

Hope this helps

gr8fasushi commented: very helpful, thank you! +1
lolafuertes 145 Master Poster

Change lines 15 and 41 to

dataGridView1 = new DataGridView();

Hope this helps

lolafuertes 145 Master Poster

Try the BGInfo utility from MS (http://technet.microsoft.com/en-us/sysinternals/bb897557)

Yu can launch it from VB (i.e. Shell("BGInfo.exe")). See the possible parameters and configurations to obtain the right result.

Hope this helps

lolafuertes 145 Master Poster

Maybe on line 12 of your example you can add:

Dim Parts() As String = Lines(0).Split("="c)

then show the Parts(1)
or change the line 14 to

Me.TextBox1.Text=Lines(0).SubString(Lines(0).IndexOf("="c) + 1)

The first solution can fail if no '=' sign exists.
The second solution will show all the line content is no '=' sign exists.

Hope this helps

lolafuertes 145 Master Poster

Just some comments.

Your Billing and Findings Tables must have a field with ConsultNo to link with the Consultation table. Change the relation according.

Probably you need to connect Medication to the Doctor and to the Pharmacy so you'll need the fileds for DoctorId and PharId in the Medications table and change the relations according.

On the Appointment table you'll refer also to the Nurse and to the Patient related to this appointment, so add the NurseId and PatId fileds to the appointment table and change the relations.

Probably you will add a relation between Lab_results and MedTech. Also you will need tohave the result values, and alslo the reference min/max values and the unit of mesure for the Lab_Results.

On the confinement table maybe you will know the patient, adding the PatId and setting the corresponding relation between Patient and Confinement.

Abut the OutPatient relation to the Patient defined 1 to 1 means that you never can creat a new patient, because you need an existing outpatient with the same ID, but you alse never can create an outpatiente because you need an existimg patient with the same Id. to solve this, you can add a OutPatient flag in the Patient table and forgot about the OutPatient table.

Hope this helps

lolafuertes 145 Master Poster

Just wondering if you cann add an external monitor with higer resolution

lolafuertes 145 Master Poster

Thanks for your feedback.

lolafuertes 145 Master Poster

I Undertand.

Instead of looping on IsBusy you can:

dim myString as String
Function GetSite(ByVal as URL as String)
StartDownload(URL)
WebBrowser1.DocumentText = mystring
Retrun Nothing
End Function
Dim DataReceived as Boolean
Function StartDownload(ByVal URL As String)
Dim _client As New Net.WebClient
        Dim URL As String
        AddHandler _client.DownloadStringCompleted, AddressOf DownloadStringCompleted
        If My.Computer.Network.IsAvailable Then
            DataReceived = False
            _client.DownloadStringAsync(New Uri(URL))
            Do While Not DataReceived
                System.Windows.Forms.Application.Doevents()
            Loop            '
    End If

Return Nothing
End Function

Function DownloadStringCompleted(ByVal sender As Object, _
ByVal e As system.Net.DownloadStringCompletedEventArgs)
    DataReceived = True               
    If e.Cancelled = False AndAlso e.Error Is Nothing Then
         myString = CStr(e.Result)
    End If
Return myString
End Function

Hope this helps

lolafuertes 145 Master Poster

Sorry.
Really you do not need to add the printform in the controls of the form.

Please try some thing like:

Public Sub PrintScreen(ByRef frm As System.Windows.Forms.Form, ByRef FormHeight As Short)
	PrintForm1.DocumentName = frm.name ' or fr.text or whatelse to identify it
	PrintForm1.Form = frm
	PrintForm1.PrintAction = System.Drawing.Printing.PrintAction.PrintToPrinter
	PrintForm1.PrinterSettings = CType(resources.GetObject("PrintForm1.PrinterSettings"), System.Drawing.Printing.PrinterSettings)
	PrintForm1.PrintFileName = Nothing
.
.
	PrintForm1.Print(frm, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly)
.
.

End Sub

or whatelse you need to do with the PrintForm1.

Hope this helps

Simran Kaur commented: was helpful +1
lolafuertes 145 Master Poster

Cicle over the items and determine wich one is to be removed from the list.

Just as a hint, if you cicle from last to first, removing the item will not affect to the loop.

Dim ValueToSearchFor as String = "XYZ"

For I as Integer =  ListBox1.Items.count - 1 to 0 step -1
  If ListBox1.Items(I).Tostring.Trim.Length = 0 then
    ListBox1.Items.RemoveAt(I)
  Else
    If ListBox1.Items(I).Tostring.IndexOf(ValueToSearchFor)<>-1
      ListBox1.Items.RemoveAt(I)
    End If
  End If
Next

Hope this helps

lolafuertes 145 Master Poster

PrintForm Component might require to be declared.

frm.PrintForm1.Print(frm, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly)

The form "frm" must have a control that shoud be called PrintForm1.

To add a such control in the form "frm" you can:
1) On the designer of the form add the PrintForm Control
2) On the Load event, or any place in the form before calling the sub PrintScreen, and if there is no PrintForm control already defined,

Dim PrintForm1 as new PowerPacks.Printing.PrintForm
Me.Controls.Add(PrintForm1)

Hope this helps

Simran Kaur commented: was helpful +1
lolafuertes 145 Master Poster

You need to download the Power Packs for Visual Basic and install them. Then you sould fint the printform component to add to your form.

http://msdn.microsoft.com/en-us/vbasic/bb735936.aspx

Hope this helps

lolafuertes 145 Master Poster

Any class can have a contructor.
The constructor is a

Sub New() 
... 
End Sub

You can define wich kind of parameters you need to create the new instance of the class like

Sub New( Byval Parm1 As String, Byval Parm2 as Integer )

You can define as many parameters as you need

Inside the sub new you can do whatever you need.

Also you can define som public methods or functions to do the work

In order to return values, you can or define functions or define some properties for the class

On the Caller you must create a new instance of the class
Using the created instance you can Call the methods, call functions returning values or get the properties.

Hope this helps

lolafuertes 145 Master Poster

You can try something like

Dim WithEvents Frm As FormRestoreDB
	Dim OpenForms As FormRestoreDB()

	Private Sub BtnOpenDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpenDB.Click
		'
		'	Create a new instance
		'
		Frm = New FormRestoreDB
		'
		'	Add to the forms collection (if you need it). 
		'
		If OpenForms Is Nothing Then
			ReDim OpenForms(0)
		Else
			ReDim OpenForms(OpenForms.Length)
		End If
		OpenForms(OpenForms.Length - 1) = Frm
		'
		'	Show the form
		'
		Frm.show()
	End Sub

When you create a new instance, the fired event of each instance will go to the same parent handler.

Hope this helps

lolafuertes 145 Master Poster

A possible solution:
a) Clean the Debug folder of your project.
b) Compile/Test your project again in Debug mode.
c) Burn a cd with the content of your Debug folder.