229 Posted Topics
Re: Hi I downloaded that example from MSDN and the difference that I can see is that the author has added 26 columns (A through Z) and set the View property of the ListView to Details. I downloaded your code, added a ListView and did the above and it works fine. … | |
Re: Hi Enclosing the field names in square brackets [] within the sql statement will allow you to create them without the need for quote characters. Having said that, it is not good practice to have field names contain characters such as "/". Is there not a better naming convention you … | |
Re: Hi If this is a true ini file that could contain more than one value or section then you should consider using the API's that were created for managing ini files such as GetPrivateProfileString and WritePrivateProfileString. Check out this tutorial on [working with ini files](http://www.vbexplorer.com/VBExplorer/focus/ini_tutorial.asp) for more information and examples. … | |
Re: What software? Do you literally mean VB.NET? If so, take a look at [this Wikipedia entry for a brief explanation and history](http://en.wikipedia.org/wiki/Visual_Basic_.NET), otherwise, please provide more information. | |
Re: Hi Could the second stored procedure that returns the data not return the data in the same format (i.e. same column headers) so that you can simply bind the DataSet to the DataGridView? Otherwise, another option would be to loop through the returned data in the first data table and … | |
Re: Hi I am assuming this is a design time error and not a run time error judging by my quick bit of research on Google. I am sure there are a number of reasons why this might be caused so it is difficult to offer a solution just based on … | |
Re: Hi Unfortunately you cannot just set the background image property to the return value of reader("pic") whcih I assume at this point is a byte array (if you have saved the image to an Ole Object field). Instead, you first need to convert the value of reader("pic") to a byte … | |
Re: Hi Not sure what you mean by: > but i want fix number of tables in combobox which changes is require in this query? Can you elaborate further please. | |
Re: Hi Are you trying to show the Total price for all Londoners? If so, the SQL would be different, something like: `SELECT SUM(Price) AS TotalPriceForLondon FROM transactions WHERE Town='London'` Then in your code you can use the TotalPriceForLondon column name which has been created using the AS keyword. In your … | |
Re: Hi You could use the PIVOT function to create a CrossTab table so that your Rent, Car, Food and Bills becomes columns. Then you can simply read the data into your program as standard. SELECT Rent, Car, Bills, Food FROM ( SELECT dbo.expenseCode.ExpenseType, dbo.expenses.Cost, dbo.expenses.Date FROM dbo.expenses INNER JOIN dbo.expenseCode … | |
Re: Hi Not sure I understand your question. Are you saying that if you click btnSnacks then you want to hide btnDrinks and if you click btnDrinks you want to hide btnSnacks? Although how that would work I am not sure as one will be visible while the other would not. … | |
Re: Hi The following SQL should work but tested in SQL Server, not MySQL. SELECT derivedtbl_1.cardNo, derivedtbl_1.regName, dbo.mainsubagent.firstName + ' ' + dbo.mainsubagent.lastName AS mainAgentName, mainsubagent_1.firstName + ' ' + mainsubagent_1.lastName AS subAgentName, derivedtbl_1.installmentAmt FROM (SELECT p.cardNo, p.regName, p.installmentAmt, r.mainAgentId, r.subAgentId FROM dbo.payment AS p INNER JOIN dbo.registration AS r ON … ![]() | |
Re: Hi Is the client database and server database using the same database technology> For example, are they both SQL Server? Does the client have access to the server database? Does the copy need to be done via code or can it be done via some for of Data Transformation Service … | |
Re: Hi Not 100% sure what you are trying to do but I did notice some errors in your SQL statements. Your INSERT statement should look like: `INSERT INTO tbl_studentadm (TimeIn, TimeOut) VALUES ('" & txtadmno.Text & "', '" & txtcard.Text & "')"` Your update statement is also wrong but I … | |
![]() | Re: Hi A couple of things: 1. Student ID, is this a numerical value in your database? I believe it is and if I am correct then your query does not need to use the ' characters as these are for strings. So change your query too: `"SELECT * FROM Subjects … ![]() |
Re: Hi If no item is selected in the ListBoxassign then you will receive a NullReferenceException error. You need to check that an item is selected before trying to use it: `If ListBoxassign.SelectedItem IsNot Nothing Then` HTH | |
![]() | Re: Hi Are you sure that you are returning a value? Try adding: `MessageBox.Show(cmd.ExecuteScalar().ToString` Before assiging it to the Text Box to see if a value is actually returned. HTH ![]() |
Re: Hi I don't mean to come across as rude but your statement about Format and quotation marks is incorrect. In fact, for Access the # character should be used for date formats, ' character for strings and nothing for numbers. With regards to Format, it can be used to prepare … | |
Re: Hi You are correct in that the error is caused because you are attempting to insert a record into your expenses table without a related record existing in your expense_code table. Your expense_code table is commonly referred to as a Lookup table as it contains values that will be used … | |
Re: Hi A couple of things to note. Firstly, the syntax for getting the Desktop Directory is slightly off as you are calling GetFolderPath twice whereas it only needs to be done once as in: `Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))` This is the reason you are getting the Exception as the GetFolderPath expects an Integer … | |
Re: Hi You state that your DataGridView is data bounded. If it is bound to a DataTable then you could use the following lambda statement to count the occurrences of a given value. For example: Dim dt As DataTable = CType(DataGridView1.DataSource, DataTable) Dim count As Integer = dt.AsEnumerable().Count(Function(dr) dr.Field(Of String)("Animal").Equals("Cat")) HTH | |
Re: Hi Your syntax is a little wrong as you are not closing the string for the SQL statement. It should be: Dim da As New OleDbDataAdapter("SELECT * from EncodingComplete where Date_Bill BETWEEN @startDate AND @endDate AND Client like @client Order by Date_Bill desc", con) HTH | |
Re: Hi If it is just standard data that you want to export to Excel, have you considered just exporting the data to a CSV file which the user can then open in Excel. Alternatively, if you want to create sophisticated Excel files then I can recommend [Aspose Cells](http://www.aspose.com/.net/total-component.aspx) which I … | |
Re: Hi Do you want to include the DateRange within your SQL statement? If so, you could use the BETWEEN operator, for example: `SELECT * FROM EncodingComplete WHERE YourDateField BETWEEN #01/01/2010# AND #01/01/2011#` Note, depending on the database you are using you may need to substitue the # character with a … | |
Re: Hi Do you want to assign the date to the variable column? If so you would do something like: `var column = list[1].Date;` HTH | |
Re: Hi Do you literally want to create your own or could you use one of the multitude of available calendars that already exist. For example: * [FullCalendar](http://fullcalendar.io/) * [jQuery Datepicker](http://jqueryui.com/datepicker/) HTH | |
Re: Hi Are you referring to a MonthCalendar control for Windows Forms? If so, you have a SetDate method that you can use to specify the date that should be selected. If you combine this with the SelectionEnd property (this property specifies the last date selected - so if a range … | |
Re: Hi When outputting the value of the DateTime you can use the ToString method and pass a format string. For example: Console.WriteLine(Date.ToString("dd/MM/yyyy hh:mm:ss")); HTH | |
Re: Hi Why would you need to do this? If your database table states that DateOfBirth is a datetime field then it will be a datetime value. Are you looking to validate input data before saving it to the database? Anyhow, I am not an expert in Javascript but I don't … |
The End.