lolafuertes 145 Master Poster

Is the listview view property set to Details?

If this property is not set to details, no columns can be shown.

Please see here for help

Hope this helps

lolafuertes 145 Master Poster

You miss to save the settings.

My.Settings.Save() will do the tric.

Hope this helps.

lolafuertes 145 Master Poster

Another approach is 'select top 1 staffid from staff order by staffid desc'.
This will return only one record with the highest staffid.

If you need to obtain the new id directly from the db, you can 'select top 1 staffid+1 from staff order by staffid desc' or 'SELECT MAX(staffid)+1 FROM staff' (hint by hericles) assuming that staffid is a numeric field.

Please, have in mind that all of those aproaches are valid only in a mono user environment.

Hope this helps.

lolafuertes 145 Master Poster

You can install any OS if you have the valid drivers for your hardware.

Hope this helps

lolafuertes 145 Master Poster

Maybe because:
A) the boot sector of the disk has been 'destroyed'
B) the disk is not detected at all
C) There is no disk with valid operating system bootstrap.
D) the disk is 'broken'

You can try to verify the disk for bad sectors in another PC installing it as secondary disk. If the disk is not detected maybe is broken and may be replaced.

If is detected then run a CHKDSK /B in order to re-evaluate the disk for bad clusters, locate bad sectors and try to recover readable info and fix basic errors like jurnal, lost entries or recover NTFS indexes, etc. After that, try to moyunt the disk again in your computer.

If this did not work, you can use the Disaster Recovery Disk you created just after the very first installation of W7 in your computer to try to repair the disk.

If you do not have such a disk, then start from the W7 installation CD/DVD and try the recovery option.

If none of the preceding steps can help, then a fresh W7 installation with full disk formatting may help.

Hope this helps

lolafuertes 145 Master Poster

If this solved your question, please be so kind to mark the thread as solved.

Thanks in advance

lolafuertes 145 Master Poster

Session variables are not intended to hold objects like images.
IE: if the image has 8MB an was stored in a session variable, the server memory will be filled with the session cookie for this requests until the session expires or you clean the session variable.

If a large number of requests are made to the server, the server memory will be overloaded and the server will crash.

Said that, Yes, your sentence is correct to store the image into a session variable. But..once you stored the photo in the session variable, it should be retrieved as a memory stream from the variable, converted to a bitmap and saved in a temp image folder in order to be presented in the web page.

IMO, there is no reason to store images in SQL server, nor in Session variables.

Hope this helps.

lolafuertes 145 Master Poster

We create a function or method in VB using the following:

Sintax for a method:

Sub Methodname
'
' Place your method here
'
End Sub

Sintax for a function:

Function FunctionName as TypeOfReturnValue
'
' Place here your function
'
Return TheValueToReturn
End Function

Please read here (and next chapters) to learn howto.

Hope this helps

lolafuertes 145 Master Poster

Yes, and better in a MySql forum, but...
Always we try to help.

Cheers

lolafuertes 145 Master Poster

The triggers are declared at database engine, so you need to administer MySQL database to create a trigger to do that.

You can find here the reference on how to create a trigger in MySQL version 5.6. On this page you can find manuals for other versions.

Hope this helps.

lolafuertes 145 Master Poster

It seems that you miss the From EmpBenefit clause in yor DAL code line 15.

Is that right?

Hope this helps

lolafuertes 145 Master Poster

Assuming that this.dataset.Table is the source for your datagridview, maybe you need also refresh the datagriview after reloading the data into your table.

If this is not th case, please post all your code related to the datagridview manipulation.

Hope this helps.

lolafuertes 145 Master Poster

IMO, to do that, you need to migrate your database from SQL Server Express to SQL Server, install a SQL Server instance on the server and create the database once.

In this scenario, SQL server will be network reachable. There are several versions and licensing options, but probaby teh SQL server 2008 Standard will be enough for most of applications. See here for editions details.

You must have in mind that this will be a multi-user capable environment and, depending on how you programmed, will be necessary to migrate your application to forceably implement transacions to ensure that insert, update and delete commands execute properly isolated.

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

Can you be so kind to indicate in wich line the COMException appears and wich is the associated error value?

Which Excel version are you using?

Which Interop assemblies have you added to your project?

Yours

lolafuertes 145 Master Poster

If it works do not change it, always says my teacher. ;)

Maybe I can suggest another way to get that, but only for discussion. This has not been tested:

Public Class Form1
'
' Do you really want to have only 5 files?
' I will suggest to work with FileInfo instead, because you can have more control on what is happening with the file
'
'    Dim strFile() As FileInfo  ' But really we need no array
    Const strPath As String = "C:\Definition Data" ' declaring as a constant will not waste time nor memory on each new assignement

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'         strPath = "C:\Definition Data\"
'        Dim i As Integer
'        Dim strFile(5) As String
'        For i = 0 To 3
'    I will suggest to change this in a for each loop 
         For each existingFile as FileInfo in My.Computer.FileSystem.GetFiles(strPath)
'            strFileName(i) = strFile(i).Remove(0, strFile(i).LastIndexOf("\"))
'            cmbDefnTerms.Items.Add(strFileName(i))
' add it directly as object in the combo. 
' The file names will be OK as the default ToString for a FileInfo
' obtained using GetFiles is the file name, not the full path
              cmbDefnTerms.Items.Add(existingFile)
        Next
        
    End Sub
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbDefnTerms.SelectedIndexChanged
'         strPath = "C:\Definition Data"
        Dim FiletoShow as FileInfo = Ctype(cmbDefnTerms.SelectedItem, FileInfo) ' this will retrieve the selecte Item 
        If Filetoshow.Exists then ' you will verify that the file exists before showing it
            try
                 txtDefinition.Text = …
lolafuertes 145 Master Poster

try to remove the () after thisArray like

thisArray.Add(dr.Item("ACODE").ToString)

Hope this helps

lolafuertes 145 Master Poster

Using a dataview.

See howto here

Hope this helps

lolafuertes 145 Master Poster

If you read the line in a string array, you can cicle over the string.Chars array to coun them using some thing like:

' This is an untested code
' Also is assumming you are using the Microsoft.VisualBasic namespace
Dim TabsCount as Integer = 0 ' this will return the number of tabs at the beginning
Dim CharacterPosition as Integer = 0 ' this will be the pointer to the character array
While CharacterPosition < InputLine.Length And InputLine.Chars(CharacterPosition) = ControlChars.Tab ' this will stop counting if you reach the end of line or a character other than tab
    TabsCount +=1 ' increase the counter
End While

Hope this helps. If this solved your question, please be so kind to mark this thread as solved.

lolafuertes 145 Master Poster

When you cn.GetSchema() you are retrieving the metadata info, not the tables info. The metadata info will give you the collection names you can retrieve using cm.GetSchema(CollectionName). You must enumerate the results in order to obtain the specific collection name for the tables info.

Please read here and there for the GetSchema() common and specifics.

Hope this helps.

lolafuertes 145 Master Poster

Wich are the SQL sentences you have written in the DeleteCommand, InsertCommand and UpdateCommand of your OleDbDataAdapter?

They ar not shown in your code and are required to call the Update.

Sincerely

lolafuertes 145 Master Poster

In order to do that you have several approaches:

1) when the user finishes to input the miles, you can launch an event to indicate the number of miles driven, to be catch by the vehicle.

2) if the input form is launched from the vehicle using a showdialog(), then the input can have a public property milesdriven that can be read from the vehicle just after the showdialog. This property can return the textbox input value.

Hope this helps

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

The answer is yes, you can. But ...

If you deploy it with your solution, the app.config file contains the initial settings for the application. This file has an XML format so can easely be retrieved.

The problem appears when the application A changes the settings at run time. Normally, the settings have a user scope and are stored in a user.config file in the application data (Local and/or Roaming) of the user (IE: "C:\Users\YourUserName\AppData\Local\SoftwareManufacturer\ProgramName.exe_Url_1tqa5xx0r3nrxtninucg0vbmopokfgt1\AssemblyVersion\user.config" )

You must know exacly the path to access it, and usually, this is created at the very first change of settings of the application.

In resume, you must know the right place to read the setting of the application A from the application B, and must have almost read permissions to all the path where the files are located.

To read an xml file is enough to use the system.io.streamreader. You can also import it in a dataset using the system.data.dataset.readxml() method.

Hope this helps

lolafuertes 145 Master Poster

A .csv file is just a text file with the column data being separated by the list separator character defined in your control panel, regional and language options.

Many places define it as the semicolon character ( ; ).

Usually the very first row written in the csv file, contains the column title, but is not required. All the data written in the file is text, so numeric values sould be formatted using the right format. You can use the System.Globalization.CurrentUICulture to obtain the right formatting characters for you.

Is recommended to have the file UTF encoded in order to support 2 byte string characters for languages others than English.

You can use a TextWriter or an StreamWriter for those purposes.

Hope this helps

lolafuertes 145 Master Poster

If the relation is defined to have cascade triggers on update and/or deletion, then the user must have permissions to update and/or delete in all the child related tables. If the cascade has multiple levels this applies to each level of the cascade trigger.
See this article

There is another appoach using stored procedures ownerchip chaining to circumvent this situation. See this other article with examples on how to.

Hope this helps

lolafuertes 145 Master Poster

Basically the update will have the form of

UPDATE table SET field = vlaue WHERE update_condition;

If you need to update more than one field you can

UPDATE table SET field1 = value1, field2 = value2, ... WHERE update_condition

If you are referring to the arrays of strRooms(x) to create the update condition, it will work exactly as the delete contition. You can copy-paste it.
:)

Hope this helps

lolafuertes 145 Master Poster

Yes. It is.

In order to have a loop, you need a loop structure like for or while.

Inside the loop, you need to modify the row to read from. When you request the range from cell "A1" to cell "A1", you are requesting the cell at column 1 (A) and the row 1, with "B1" you are requesting the column 2(B) and row 1 and with "C1" you are requesting column 3 (C) and row 1.

If you implement a row (integer) counter, you can cicle over the rows in the excel sheet, changing the row suffix of the cell name, in the get_range call, using string cellName="A"+row.ToString(); in order to get the cell name for column 1 (A).

This way, you will call the getr_range funcion like get_range(cellName, cellName) .

In order exit timely from the loop you need to know the number of filled rows before starting the loop, or you can break the loop when the cell in colum A has an empty text.

Here we have another problem to solve: the output. If you want to show all the excel sheet content, having text boxes, maybe, is not the best aproach, even it can be valid. If you only wants to show the last row with data, then this is not a bad aproach.

If you want to show all the rows in the tex boxes, before starting the loop you'll need to empty …

lolafuertes 145 Master Poster

If you use a dataset to hold the relevant info, when the user changes the filter criteria you can:
- Fill it with an adhoc query or
- Create a DataRowView agains the relevant datatable to filter the required data or
- Use a Linq expression to select the relevant info.

Another possibility is that you use a datareader created from a command with an adhoc query to obtain the data.

Hope this helps.

lolafuertes 145 Master Poster

You can use the Cell(int row, int column) range instead. This is an 'easy' way to navigate in the Excel sheet.

To do that, you need to set the excel application ReferenceStyle to the xlReferenceStyle.xlR1C1 in order to enumerate the rows and columns by numeric integer value starting at 1.

Then you can substitute the .get_Range("A1", "A1") by .Cells( 1, 1).

You can find the last row to precess using the UsedRange.Rows.Count and UsedRange.Columns.Count properties of the worksheet.

Hope this helps.

lolafuertes 145 Master Poster

Do you have an AssemblyInfo.vb in your project?
Please read here

Hope this helps

lolafuertes 145 Master Poster

You can start reading this to learn how arrays work in C#.

Hope this helps

kvprajapati commented: :) +15
codeorder commented: "just because" a -rep.point is not appropriate for this post.:) +12
lolafuertes 145 Master Poster

Please post what you dessigned/written so far.
Sincerely

lolafuertes 145 Master Poster

Please post what you have designed/written so far.
Sincerely

lolafuertes 145 Master Poster

@adam_k. Thanks for your feedback.

I will always agree that data in RAM is not a good practice, but I will not discuss the design quality of the program, almost on this thread, because that's not the question from scrivomcdivo.

Obviously, hard coding is always a bad practice also, but, again, I will not discuss the design quality of the program. Many programming teachers teach with bad designs in order to focus the solution on a distinct point, ie an array research or update algorithm, and because I do not know if this is the case, I do not discuss the design quality of the program.

Also, you are right when you say that, in order not to loose the info, is required to save the data after some time or after each relevant update. But this is a must how-to for any data layer you use.

Arguing on my answer, one of the advantages to use a dataset is that the number of rows can be increased o diminished when needed without nedd to recode the program.

Using an external editor like XMLNotepad to populate the dataset does not implies the need to recompile the program when defining the rows. Also this provides an external-to-the-program cheep (free) tool to mantain the data if neded.

Sorry for the long rant. You can see I agree with you.
Cheers.

lolafuertes 145 Master Poster

Every high level languages has a compiler( or interpreter) who is responsible to translate them into machine low level code.

In C#, the compiler produces executable (.exe) files, dynamic-link libraries (.dll), or code modules (.netmodule) depending the options you use.

The code modules need to be linked in order to produce assemblies.
An assembly is the basic deployment unit and maybe an exe or dll file.

You can read the Compilers: Principles, techniques and tools to help understand how they work.

lolafuertes 145 Master Poster

@adam_k: can you be so kind to argue your points?

Thanks in advance.

lolafuertes 145 Master Poster

One of the ways to obtain what you need is to create a Sub FillOrdersCombo using a paramenter indicating the Idvalue of the selected item in lbMatchingAccounts, to be called when the account is OK.

in order the call to this sub does not fail, you will need tochange silightly the following code:

Private Sub lbMatchingAccounts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbMatchingAccounts.SelectedIndexChanged
        Dim SQLStmt As String
        SQLStmt = "select * from BEs where Id=" & lbMatchingAccounts.SelectedItem.IdValue
        Debug.Write("SQLStmt=" & SQLStmt & vbCrLf)
        Cnxn = New SqlCeConnection(My.Settings.Database1ConnectionString)
        Cnxn.Open()
        Dim cmdSelectedRecord As New SqlCeCommand(SQLStmt, Cnxn)
        Dim SelectedRecord As SqlCeDataReader = cmdSelectedRecord.ExecuteReader
        Dim IdValueExists as Boolean = SelectedRecord.Read
        SelectedRecord.Close()
        Cnxn.Close()
        Call FillOrdersCombo(lbMatchingAccounts.SelectedItem.IdValue)
        If Not IdValueExists Then
            lblAdvice.Text = "No record found for '" & lbMatchingAccounts.SelectedValue & "'..."
        Else
            
            lblAdvice.Text = "Hit enter to use the highlighted account, or start another search..."
        End If

    End Sub

Then on the fill orders combo you must:
1) clear the orders combo
2) select the orders for the IdValue selected
3) fill the combo with the obtained results.

Hope this helps.

lolafuertes 145 Master Poster

The ToolStripMenuItem.Invalidate method forces to redraw the control.
This will show the right image you set.
See here

Hope this helps

lolafuertes 145 Master Poster

Actually is not an infinite loop. It will run for 100 times, when you need only 10.

You can simplify the for-next using:

For row = 0 To ROWS - 1
            For column = 0 To COLUMNS - 1
                        Console.WriteLine("Enrollment for " + campus(column) + " for the " + semester(row) + ":")
                        tempArray(row, column) = CInt(Console.ReadLine())
            Next
        Next

In the GetTotal function you may siplify it using:

For column = 0 To COLUMNS - 1
                Dim total = 0
                For row = 0 To ROWS - 1

                    total += tempArray(row, column)
                Next
                    Console.WriteLine("The total enrollment for  " + campus(column) + " is: ")
                    Console.WriteLine(total)
            Next

Hope this helps

lolafuertes 145 Master Poster

IMO the easy way is to use a dataset.
The dataset can contain a table holding a row for each seat with the relevant seat info.

The dataset can be persisted on a XML file when exiting, and can be retireved at the start of the program.

As is in XML format, you can use XMLNotepad from MS to populate it the very first time.

Hope this helps

lolafuertes 145 Master Poster

Use the system.globalization to get the cultureinfo for the CurrentUICulture to obtain the decimal char, thousands separator, etc. and replace them by those of the invatiant culture. The thousands separators can be safely removed.

Hope this helps

lolafuertes 145 Master Poster

I assume that on the mouse hover and leave events you are assigning the right image.
Then, do you call testToolStripMenuItem.Invalidate after assigning the new image to force the redraw of the control?

Hope this helps

lolafuertes 145 Master Poster

In C# static means no need for instantiation.

Inside a static method (Main) you ar calling a non static function Addtion. According to the C# rules, you need to declare Addtion as static like

static public int Addtion(int number1, int number2)

Hope this helps

lolafuertes 145 Master Poster

I will put the source table field only on C.

The referential integrity between table C and the sources A and B is to be mantained using triggers.

Hope this helps.

lolafuertes 145 Master Poster

If any conversion shoult take pleace, always is recommended to use a try/catch structure to catch any exception and be able to process as expected.

Most of the problems with number conversions came of not testing, with some regex, that the input value is a valid number.

Also, many times is needed to convert the number format from local culture to invariant culture, using the System.Globalization, in order to process smoothly.

Hope this helps

lolafuertes 145 Master Poster

IMO The best way is to add a field indicating the source table, then another with the key value to the source service.

The PK would be both fields. This way, you can have the same key value, but always coming from a distinct table.

Be aware to add a DELETE trigger on each source table in order to delete the related record in the C table.

Hope this helps

lolafuertes 145 Master Poster

This namespace is available throug the Data Designer Extensibility (DDEX) SDK (part of the Visual Studio Industry Partner [VSIP] installation). Then it appears as reference to add to your project.

For info on how to obtain it you can navigate here

Hope this helps.

lolafuertes 145 Master Poster

In the resources tab of your project properties, you need to import the image into the resources of the project (not the resource folder). This will create a resource file containing the resources of text, images, icons and any other kind of serializable object you need.

Hope this helps

lolafuertes 145 Master Poster

On this link you can download an example of P2P allowing file sharing, messaging between peers, an a few utilities more. This is an open source from Source Forge so you must honor the creator open source license.

Hope this helps.