|
Hmmm... Good to know. I didn't catch it because I don't use Access for anything. I always go for some flavor of SQL Server.
|
|
|
|
|
Yeah, I remembered that from years back. I now use MySQL exclusively.
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
|
|
|
|
|
Can anyone help me on how to display the records of the table from sql server on the treeview control.
Note: I only want is to display the records only on the column1.
|
|
|
|
|
daemonsead2008 wrote: I only want is to display the records only on the column1.
There is no column in TreeView, did you mean a ListView?
And what is the structure of your table? Is it hierarchical? TreeView is used to display hierarchical information.
|
|
|
|
|
I develop and support a simple VB .Net data acquisition application for a University. A request came in from one of our Spanish clients to have the numbers display on the gui in their local numerical format where the decimal point and comma are swapped from their customary positions in the US. In Windows 7, I can easily change the number format using the control panel and in fact this does change the format for most of the numbers in the application with no programmatic intervention on my part. For instance, voltage readings are displayed in text boxes in the appropriate format, but for some values which are assigned to the TEXT property of a label are still displayed in the US format. I have seen a lot of discussions regarding setting the locale on the thread but I would prefer not to have to intervene that way. My question is how do the numbers display properly sometimes but not others automagically? Is their a property on the text box or label that turns on this on? I suspect it has to do with how I assign values to text properties. I use the FORMAT method as
Textbox.TEXT = format(1.0,"0.0")
but I also tried this with the label with little success. Is this because the numbers assigned to text boxes are changing dynamically while the label text is static after loading? In insight would be appreciated.
Regards,
Bob
|
|
|
|
|
bobmc11 wrote: Textbox.TEXT = format(1.0,"0.0")
Where did the format function come from?
You can try using this:
txtBox1.Text = myNumber.ToString("c");
For a more detailed explanation, go through this[^] article.
|
|
|
|
|
Hi all...
When I execute update query, I get error "data type mismatch in criteria expression"
I used following code :
Try
DBConnection.connect() 'code to open database.
Dim sql As String = "update MortgageDetails set [Borrower_Name]='" & txtBorrowerName.Text & "', [Caste]='" & txtCaste.Text & "', " & _
"[Area]='" & txtArea.Text & "', [Address]='" & txtAddress.Text & "', [Product_Detail]='" & txtProductDetail.Text & "', " & _
"[Current_Date]='" & txtCurrentDate.Text & "',[Current_Value]=" & txtProductValue.Text & "," & _
"[Amount_Borrowed]=" & txtAmountBorrowed.Text & " where [S_No]=" & txtSNo.Text
Dim cmd As New OleDbCommand(sql, con)
cmd.ExecuteNonQuery()
MsgBox("Record Updated!", MsgBoxStyle.Information)
Me.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
I am using VB2008 and MS Access 2003 as database.
Suggest me what to do.
Thanks.
Gagan
|
|
|
|
|
Sounds like you are passing some data to the table as text when it should be numeric or some other non string format but without seeing your table definition its hard to say something else.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Passing literal data like that always is asking for trouble. The exact problem is most likely the date you have there. Passing dates and other non-string types depends on the exact database you use, and is often problematic.
Suggestion:
1. use programming variables, and TryParse() your textual input before passing the info to the database; this traps input errors and avoids SQL injection;
2. use SqlParameter and pass the above variables; don't use literals in SQL.
In will take a bit more code, but the result will be much more robust.
|
|
|
|
|
Seems the problems is with this piece of code:
"[Current_Date]='" & txtCurrentDate.Text & "'"
Access expects dates to be passed in a specific format, try this:
"[Current_Date]=#" & Convert.ToDateTime(txtCurrentDate.Text).ToString("MM/DD/YYYY") & "#"
|
|
|
|
|
Thanks for your answer. It worked.
|
|
|
|
|
You're welcome. Please mark it as answer so your post doesn't appear unanswered.
|
|
|
|
|
Hi,
I'm developing a VB.NET application that manipulates 6 Excel files and genetates one sinle Excel file using data stored in those 6 files. This is needed to make my job easier.
I'm assuming those excel files as database tables, and in order to create my final excel (like View/Query in databases) i need to get data from each of the excel files (like taking maching columns OR joins).
The way I want to implement the application is: taking each excel files from OpenFileDialogs in VB, running SQL queries on those excel files, and generating the necessary excel file by a single button click.
I think I could explain the case well and you understand everything with the situation..
Now, the question is:
1. Can I run sql queries on excel columns?
2. Wouldn't it be too slow if I have 63000 rows in some of my excel files?
3. If yes, can you give me some code samples to run SQL Queries on two (already exist) excel files and generating the third-one based on these files (like what we do in database views)?
Your help will be really appreciated!!!
thx.
modified 6-Oct-18 21:01pm.
|
|
|
|
|
|
Wouldn't it be too slow to work with worksheets which contain 65000 rows?
modified 6-Oct-18 21:01pm.
|
|
|
|
|
Why don't you try it and benchmark against a sql example. (The Excel solution will definitely be slower.)
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
IMHO with OleDb, creating connection will be a bit slower but querying data should not be.
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
|
|
|
|
|
You are correct on a single client, although across a network is a different story.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Vista\Win7 - Is it possible to shell and specify an account to run the process under?
Scenario: our company has a program that is a launcher app (kinda like a fancy version of click-once). Based on the arguements passed in, it determines what program the user is trying to run and what files need to be updated (controls, .dlls, etc), pulls them down from a shared directory and registers them (regsvr32 or regasm). After that process is done, the program that was requested is launched via shellex.
In Vista and Win7 the regsvr32 and regasm functionality is broken because of UAC. The user has admin rights to only 1 folder in the Program Files directory (that is the location where the .dlls, etc are pulled down to). Is there a way to perform a shell (so that regsvr32 can be run) using a admin account (specifying user and password in code)?
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Try launching regsvr32 like this:
System.Diagnostics.Process.Start("regsvr32.exe", username, password, domain);
|
|
|
|
|
I tried your suggestion but was unsuccessful.
Process.Start("C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe", """" & "C:\Program Files\CompanyApp\System\dbDAL.dll" & _
"""" & " /codebase", "AdminAcct", pw, "Domain")
The exit code = 100. Nothing errors off, but the assembly isn't registered correctly and can't be instantiated. If I run the SDK command prompt in adminstrative mode and run the same command and arguments, then the object and be instantiated correctly.
Despite specifying the admin account, UAC appears to be blocking the registering. Sigh.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
|
How to use ComboBox DisplayMember and ValueMember without database?
|
|
|
|
|
I use this
color1 = New BaseColor() {iTextSharp.text.BaseColor.BLACK, iTextSharp.text.BaseColor.BLUE, iTextSharp.text.BaseColor.CYAN, iTextSharp.text.BaseColor.DARK_GRAY, iTextSharp.text.BaseColor.GRAY, iTextSharp.text.BaseColor.GREEN, iTextSharp.text.BaseColor.LIGHT_GRAY, iTextSharp.text.BaseColor.MAGENTA, iTextSharp.text.BaseColor.ORANGE, iTextSharp.text.BaseColor.PINK, iTextSharp.text.BaseColor.RED, iTextSharp.text.BaseColor.WHITE, iTextSharp.text.BaseColor.YELLOW}
color2 = New String() {"Черен", "Син", "Циан", "Тъмно сиво", "Сиво", "Зелено", "Светло сиво", "Магента", "Оранжево", "Розово", "Червено", "Бяло", "Жълто"}
For i = 0 To color1.Length - 1
ComboBox2.Items.Add(color2(i))
Next
If File.Exists(TextBox1.Text) Then
File.Delete(TextBox1.Text)
Dim bf As BaseFont = BaseFont.CreateFont(k & "\\arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)
Dim bc As BaseColor
bc = color1(ComboBox2.SelectedIndex)
AddWatermarkText(TextBox3.Text, TextBox1.Text, TextBox2.Text, bf, NumericUpDown1.Value, bc, 50.0F, NumericUpDown2.Value)
Else
Dim bf As BaseFont = BaseFont.CreateFont(k & "\\arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)
Dim bc As BaseColor
bc = color1(ComboBox2.SelectedIndex)
AddWatermarkText(TextBox3.Text, TextBox1.Text, TextBox2.Text, bf, NumericUpDown1.Value, bc, 50.0F, NumericUpDown2.Value)
End If
|
|
|
|
|
There is no need for a database, a DataTable, or anything pre-existing. You want some class, with at least two public properties, and a collection of instances of said class. The collection (e.g. a List) becomes your DataSource; the one string property your DisplayMember, and the other property your ValueMember; so you need to provide the names of those properties in the "DisplayMember" and "ValueMember" properties of your Control (e.g. ComboBox).
|
|
|
|
|