|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
Public Sub FetchDataByName(customerName As String)
' Show debugging message
MessageBox.Show("FetchDataByName called with Name: " & customerName)
' Replace with your actual MySQL connection details
Dim connectionString As String = "Server=localhost;Port=3306;Database=MyData;Uid=asmgssl;Pwd=0786;"
Dim query As String = "SELECT * FROM customer WHERE cname = @cname"
Try
Using connection As New MySqlConnection(connectionString)
connection.Open()
Using command As New MySqlCommand(query, connection)
command.Parameters.AddWithValue("@cname", customerName)
Using reader As MySqlDataReader = command.ExecuteReader()
' Process query result
If reader.Read() Then
' Example: Retrieve data and show in message box
Dim customerId As Integer = reader.GetInt32("id")
Dim customerAddress As String = reader.GetString("address")
MessageBox.Show($"Customer ID: {customerId}, Address: {customerAddress}")
Else
MessageBox.Show("No data found for Name: " & customerName)
End If
End Using
End Using
End Using
Catch ex As Exception
MessageBox.Show("Error fetching data: " & ex.Message)
End Try
End Sub
Private Sub LoadHtmlContent()
' Define the HTML content
Dim html As String = "<!DOCTYPE html>" &
"<html>" &
"<head>" &
"<title>Test Page</title>" &
"<script type='text/javascript'>" &
"function FetchDataByName() {" &
" if (window.external && typeof window.external.FetchDataByName === 'function') {" &
" var customerName = document.getElementById('inputName').value;" &
" console.log('Fetching data for customer name: ' + customerName);" &
" window.external.FetchDataByName(customerName);" &
" } else {" &
" console.error('window.external.FetchDataByName is not available.');" &
" }" &
"}" &
"</script>" &
"</head>" &
"<body>" &
"<h1>Test Page</h1>" &
"<input type='text' id='inputName' placeholder='Enter Customer Name'>" & ' Changed id to inputName and placeholder text
"<button onclick='FetchDataByName()'>Fetch Data</button>" &
"</body>" &
"</html>"
' Load the HTML content into the WebBrowser control
WebBrowser1.DocumentText = html
End Sub
not fetch data
|
|
|
|
|
AMRO DAMMAM wrote: not fetch data
Did you debug your code?
|
|
|
|
|
You have not given sufficient information to diagnose this. "no fetch data" can mean anything at any point in this code.
You have a bunch of MessageBox statements which should be showing you the important values, but you don't mention anything at all about what they are saying.
|
|
|
|
|
Hi, When I try to install vb6 PRO or visual studio 6 Enterprise on Windows 10 pro 64 bit the following message appears:
access/path error: "cmdInstallvs6_click of frmmain2.frm" and the installation fails here
What does it mean ? How can I solve it ?
Thanks
|
|
|
|
|
You do know VB6 has been dead for over 20 years now, correct?
Even VB.NET isn't being further developed. It gets security and maintenance fixes but is not otherwise being further developed.
|
|
|
|
|
Here is something that (probably) will help you a bit more than some (not necessarily relevant) previous answer
How To Install Visual Basic 6 (VB6) in Windows 10[^]
You may also want to refer to this video, which provides an alternative method for a successful installation on Windows 11.
How to install Visual Basic 6.0 on Windows 11 - YouTube[^]
I have personally installed VB6 on Windows 10 and Windows 11 multiple times on a variety of machines, for a variety of purposes. And while it may not be a straightforward process, it can be done with minimal effort.
Hope this helps.
|
|
|
|
|
i am begginer
i have a Sql database include in 2 tables
i want someone help me to :
- how i connect to database by code
- how i can select tables
- how i read recordes
- what imports needed
thnx
|
|
|
|
|
|
I have to make an application with web service but i never make that.
The web service is Kelio of Bodet.
Somes examples could help me.
Thanks
|
|
|
|
|
Google for "VB.NET webapi client".
There's plenty of examples.
|
|
|
|
|
I want to perform a search in a DataGridView. The search command is working, but I have a problem: a row always remains visible in the DataGridView even if it does not correspond to the search criteria. This row is always the last selected one. I have tried using 'ClearSelection,' and no rows are selected/highlighted, but the problem persists—the same row is still visible. this is my code :
Private Sub TxtboxReserch_TextChanged(sender As Object, e As EventArgs) Handles TxtboxReserch.TextChanged
If TxtboxReserch.Text = "" Then
For i = 0 To DataGridView1.RowCount - 1
DataGridView1.Rows(i).Visible = True
Next
Else
DataGridView1.ClearSelection()
For i = 0 To DataGridView1.RowCount - 1
Try
DataGridView1.Rows(i).Visible = (DataGridView1.Rows(i).Cells(1).Value Like "*" + TxtboxReserch.Text + "*")
Catch ex As Exception
End Try
Next
End If
End Sub
|
|
|
|
|
You already posted this question once; please do not repost.
|
|
|
|
|
I want to perform a search in a DataGridView. The search command is working, but I have a problem: a row always remains visible in the DataGridView even if it does not correspond to the search criteria. This row is always the last selected one. I have tried using 'ClearSelection,' and no rows are selected/highlighted, but the problem persists—the same row is still visible. this is my code :
Private Sub TxtboxReserch_TextChanged(sender As Object, e As EventArgs) Handles TxtboxReserch.TextChanged
If TxtboxReserch.Text = "" Then
For i = 0 To DataGridView1.RowCount - 1
DataGridView1.Rows(i).Visible = True
Next
Else
DataGridView1.ClearSelection()
For i = 0 To DataGridView1.RowCount - 1
Try
DataGridView1.Rows(i).Visible = (DataGridView1.Rows(i).Cells(1).Value Like "*" + TxtboxReserch.Text + "*")
Catch ex As Exception
End Try
Next
End If
End Sub
modified 2-Mar-24 7:25am.
|
|
|
|
|
Try setting the CurrentCell to Nothing .
NB: It would probably be simpler to filter the underlying data source, assuming you have one.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Dim i As Integer = DataGridView1.CurrentRow.Index + 1
If i < 0 Then i = 0
DataGridView1.CurrentCell = Me.DataGridView1.Rows(i).Cells(0)
DataGridView1.Rows(i).Selected = True
End Sub
|
|
|
|
|
Look at the error message again. It is telling you that the value of your index variable is outside the range of rows in DataGridView1 . Most likely because of the line below:
Dim i As Integer = DataGridView1.CurrentRow.Index + 1
If you are currently at the last row then "Index + 1" will refer to a row that does not exist.
|
|
|
|
|
|
Check to see whether the value is in range, and not just greater than zero.
|
|
|
|
|
Better user experience:
* Disable the NEXT button when the cursor is on the last row of the grid
* Disable the PREVIOUS button when the cursor is on the first row of the grid
|
|
|
|
|
I want to output a bitmap file to a POS printer using VB6. The ESC/POS mode should be used.
Does the file need to be converted? If yes how? Is there documentation or an example?
Printing and formatting text is no problem. I just can't find any way to solve the problem.
Thank you.
|
|
|
|
|
|
Thank you.
However, the solution does not describe how to use the ESC/POS mode.
|
|
|
|
|
In my experience, the printer would come with various Windows driver(s) and / or "DOS" programs when it came to printing "bit maps". You scoured the vendor's web site for samples, downloads and links. The "name" of your printer is more important than what you've posted so far.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|