|
Why not make an effort to do your own search for examples of code for this. Paste your question into Google for a start.
Veni, vidi, abiit domum
|
|
|
|
|
|
I hope its not for spamming and spoofing! I am getting tired of Sarah from Consumer Services calling me on a spoofed voip line. I would be more upset if they were wasting my message limit
|
|
|
|
|
Is it possible to create a MySql view using vb2008 If yes can anybody provide with some tips on how to do that.
Thanking in advance.
|
|
|
|
|
SPSandy wrote: Is it possible to create a MySql view using vb2008 Yes.
SPSandy wrote: If yes can anybody provide with some tips on how to do that. Using the ExecuteNonQuery method of the IDbCommand class; you'd execute a SQL-query (Google for examples) containing a "CREATE VIEW" statement (again, Google has the syntax).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
My apologies for the above answer; it may be correct, but it is hardly helpfull. Let me see if I can improve on the answer above. There's an abstract example of what you want to achieve below; (abstract as in it contains a bit pseudocode, not as "an abstract class")
Public Sub CreateView()
Using con As New MySqlConnection("your connection string here")
Using cmd As MySqlCommand = con.CreateCommand()
con.Open()
cmd.CommandText = _
" CREATE VIEW view_name AS " +
" SELECT column_name(s) " +
" FROM table_name " +
" WHERE condition "
cmd.ExecuteNonQuery()
con.Close()
End Using
End Using
End Sub
There are a few resources you might need;
I'd also recommend downloading at least VS2010; it comes with .NET 4, which performs a bit better than the 2.0 runtime. Also gives you some nice extra's, like mini-dumps in .NET - very powerfull when debugging with one o' those. There were also some nice language-enhancements in the IDE. An upgrade would well be worth the effort.
Since you'd be going to create views, I'd also like to point out that there are various options for naming those views. It'd be redundant to add the word "view" to it, but looking at other databases, it also looks like a tradition. MySQL does not allow some characters in the view-name. The W3Schools shows such an example with spaces.
Please don't do that. Just do it without spaces. It's not just MySQL that could blow up; furtherdown the line, there's probably an ORM or something generated from that view (like a report) and than that will blow up. Then the problem probably gets posted here, and I blow up.
Going offtrack a little further; for those wondering why I have a macro autofill the quotes to a single level - it makes it easy to cut & past the query into SQL Managment Studio (using block-select, ALT-SHIFT while you select text) and to paste it back into VS.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks a lot. This was really very useful.
|
|
|
|
|
I am just wondering if it's posible to make that?
I have my MyApplication.exe inside my form and I want it to be just fix on its location?
System.Diagnostics.Process.Start("MyApplication")
Dim P As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("MyApplication")(0)
P.WaitForInputIdle()
SetParent(P.MainWindowHandle, Me.Panel1.Handle)
We can resize the panel by adding
MoveWindow(P.MainWindowHandle, 0, 0, 500, 300, True)
but its posible to make it fix on that location?
modified 11-Feb-14 10:52am.
|
|
|
|
|
Your question is not clear at all. Please try to explain it better
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
I think this link help me a lot
http://www.codeproject.com/Articles/101367/Code-to-Host-a-Third-Party-Application-in-our-Proc
Thank you
|
|
|
|
|
No, you can't. You don't have direct control over the window of a seperate process.
The thing is that the external process does not know it's window is inside your window. It thinks and works exactly like it was running on the desktop. The desktop is itself a window, just like your Panel control.
If the user grabs the title bar of the external process, they can move the window around and your code will not know anything about it. There are no events that tell you if the external process window is being moved.
The users can also hit the minimize and maximized buttons on the external process window and they will work, just as if the window was on the desktop. You can't 100% stop that from happening.
|
|
|
|
|
EYESTRA1N wrote: I have my MyApplication.exe inside my form and I want it to be just fix on its location? Let me rephrase that; you want to remove the title-bar on a Window.
Go here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you so much for the answers
It really help me a lot.
|
|
|
|
|
Hi,
I want to preview word (.docx) document on user form control in vb.net 2012. Please provide any solution!!! Urgent.
|
|
|
|
|
|
Hi Richard,
Already tried this but when followed the suggested code and steps, it is not previewing the document file in control, rather throwing dialogue box to either open / save file in respective software. but not in form.
And here in my scenario I want to view the document on form itself, in web browser control.
Any help will be highly grateful. Please...!!!
|
|
|
|
|
Danish1987 wrote: Already tried this Anything else you tried that I need not mention?
Danish1987 wrote: And here in my scenario I want to view the document on form itself, in web browser control. Why was this not in the original question?
If you want to show a docx in a webbrowser, you'll need Word to be installed on the client.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi to all Friends. first of all Excuse me for my bad english. I created an Address Label Print Program. I use PrintPreviewControl for Preview. When I click my Zoom Button about %100 in zoom is ok. Right Left Right And Bottom Margin Spaces are appear. But when 200% Zoom in PrintDocument is bigger size then PrintPreviewControl window. in this point Left and Top Margin Spaces are appear but Right and Bottom Margin Spaces not display.. can not appear. It seems like endless Paper.. I want to see right and bottom margin spaces also. in this page I found an program source codes.
http://www.codeproject.com/Articles/38758/An-Enhanced-PrintPreviewDialog
In this Program is codes are Locked can not change. I am not professional in VB.Net. thats why I just only want to know is there any simple way to see this right and bottom margin spaces at Zoom In (200%) mode. advanced thank you very much. God Bless all.
modified 10-Feb-14 17:51pm.
|
|
|
|
|
I need to send sms in vb.net windows application i tried many dll and gateway i ended in vain pls help me
|
|
|
|
|
Do not post the same question in multiple forums
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
I'm trying to run a sql statement and the parameters are based on date range and an item if the checkbox is checked. So far I get the right query result if the checkbox is checked but without it I'm getting "Command parameter 2 is invalid". Any help is appreciated. Thanks!
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim sqlsearch As String
Dim con As New OleDb.OleDbConnection
Dim date1 As String = DateTimePicker2.Value.ToShortDateString()
date1 = date1 + " 00:00:00"
Dim date2 As String = DateTimePicker3.Value.ToShortDateString()
date2 = date2 + " 23:59:59"
Dim scanner As String = ComboBox5.Text
con.ConnectionString = "provider=SQLOLEDB;data source=myserver;database=mydb;user ID=user;password=mypassword;"
If CheckBox1.CheckState = CheckState.Checked Then
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name = ? order by check_out_date desc"
Else : CheckBox1.CheckState = CheckState.Unchecked
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? order by check_out_date desc"
End If
Dim adapter As New OleDbDataAdapter(sqlsearch, con)
With adapter.SelectCommand.Parameters
.AddWithValue("@startDate", date1)
.AddWithValue("@endDate", date2)
.AddWithValue("@scanner", scanner)
End With
Dim dt As New DataTable("ScannerHistory")
adapter.Fill(dt) -- "This is where I'm getting the error."
DataGridView1.DataSource = dt
End Sub
|
|
|
|
|
In the 1st query you are passing in the 3 parameters correctly but in the 2nd query you are only passing in 2 parameters - no 2rd parameter so your add with value for scanner breaks the command!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I noticed that after I posted my question. I'm trying to see how to incorporate the 3rd parameter. Thanks!
|
|
|
|
|
Figured it out. Thanks for the feedback!
If CheckBox1.CheckState = CheckState.Checked Then
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name = ? order by check_out_date desc"
Else : ComboBox5.ResetText()
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name != ? order by check_out_date desc"
End If
Dim adapter As New OleDbDataAdapter(sqlsearch, con)
With adapter.SelectCommand.Parameters
.AddWithValue("@startDate", date1)
.AddWithValue("@endDate", date2)
.AddWithValue("@scanner", scanner)
End With
|
|
|
|
|
I am trying to add VLC component to VB.Net 2008 Exprees Edition form.
Project build successfully but at runtime getting following error.
"An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
Kindly Help...
|
|
|
|