|
hi my my name is vishal.i am exporting vb6 data to PDF using sql select query from multiple tables.. My form is loads appropriate agn numbers. However here is line below where i get error saying:item cannot be found in the collection corresponding to the requested name or ordinal.
given below is line in sql select query where i get error:
MDIForm1.loadReportinPDF "select iw.agn,ih.item_name,iw.no_of_bundle,sw.rack_name,sw.store_no from Inward iw,item_master ih,store_master sw where iw.deleted_status=ih.deleted_status", "STOCK PURCHASE-SAMPLE"
Can anyone point out how should i fix this problem.Can anyone help me please.Any help would be greatly appreciated.
|
|
|
|
|
That error usually means that you have a spelling mistake in one of the column names in the query
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Firstly thank you for replying on such short notice Mam/Sir i have checked my column names and i have typed correctly in sql select query.I will given you structure of my 3 tables(Inward,item_master,store_master) given below:
table name:Inward
Field Name DataType
mfr_ref_number Text
no_of_bundle Integer
supplier_id Integer
DC_date Date/Time
INV_date Date/Time
row_upd_date Date/Time
courier_name Text
inward_type Text
user_id Long Integer
deleted_status Yes/No
deleted_date Date/Time
DC_NO Text
closed_status Yes/No
closed_date Date/Time
store_no Long Integer
to_dept Text
agn AutoNumber
table name:item_master
Field Name DataType
user_id Long Integer
row_upd_date Date/Time
deleted_status Yes/No
status Yes/No
item_name Text
item_parent Long Integer
item_price Double
item_desc2 Memo
item_desc1 Memo
item_desc3 Memo
item_type Long Integer
item_code Text
agn AutoNumber
measure_type Text
table name:store_master
Field Name DataType
rack_name Text
rack_desc Memo
user_id Long Integer
row_upd_date Date/Time
status Yes/No
store_no AutoNumber
Sir above i have posted the structure of my 3 tables.Tell me or guide me,correct me where i am going wrong in the sql select query? Reply please.
|
|
|
|
|
Creating tables in Access using the above definitions, and running your query after cutting and pasting, it works first time.
I am confused, however by the fact you have no joins between the tables in the query, and by how the tables are related.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Hi All!
Hello all!
It’s been awhile and I’m back with another odd ball application.
I’ve never played much with Visual Studio 2013 and DOS. I’m starting with a plane-Jane form, nothing special.
I have a need to create an application that will use DOS. I know, DOS! Yes. It’s still used very widely.
What I need to do is:
1.) Have text box where I can enter a server IP
2.) Have a text box where I can enter a time in minutes. This Text box will be controlling a Timer function.
3.) Have a check box that will enable the timer
4.) Have a start button that will start the timer (based on the contents in the text box for time)
5.) A stop button to Stop the Timer cycle
6.) And finally a TEST button
What does this all do? Pings a server of the IP I entered into text box 1.
I’m working with a remote router that likes to fall asleep. Boss wants me to come up with a way we can enter the router’s IP addy, select a time in minutes and “Ping” this thing ever so many minutes.
I’ve included the form layout and am not sure exactly where to start. I’d like a text box to display the results of the ping when I click the test button as well.
So, I guess the first task is:
How can one enter an IP addy into a text box and tell DOS to Ping that IP addy and display that result in a text box?
Please let me know if this is not the right forum, it’s been a few years since I’ve been on here. Any help will be greatly appreciated.
Thanks in advance, these forums have helped me in some very odd ball projects in the past. I’d like to work through the entire project on here in this thread. Things discovered in this project could really be helpful to others.
Thanks,
-Chris
|
|
|
|
|
I'm assuming the reference to DOS is simply because you want to execute the ping command, which runs in a command-prompt?
If so, you can use the System.Net.NetworkInformation.Ping class[^] to achieve the same result.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard-
Yes! I'm needed to execute the ping command that rins in the command prompt from the IP addy I input into text box 1. I also want the out put of this to be displayed in a multiline text box.
Been all over searching and finding I'm getting more confused then I'm getting answers.
Thank you so much for the help!
-chris
|
|
|
|
|
Member 10570421 wrote: How can one enter an IP addy into a text box and tell DOS to Ping that IP addy and display that result in a text box? Look at Process.Start[^].
Member 10570421 wrote: Things discovered in this project could really be helpful to others. That's why there's the example on MSDN.
Adding the textboxes to get the params for the command should not be that hard
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You're not doing anything in DOS. DOS has been dead for a long time now. What you're talking about is a command prompt which provides an interface that LOOKS like DOS and behaves somewhat like it.
The type of application you're talking about is a Windows Forms application, that has nothing to do with "DOS". You don't need to execute PING on a command prompt at all. Ping functionality can be found in the My namespace, under My.Computer.Network.Ping(...) . You don't need to shell out to the command-line version of PING at all.
My.Computer.Network.Ping()[^] docs.
|
|
|
|
|
Hi everybody, I had a big problem in my code using timer in DataGridView. When I load my program and starting navigate automatically using timer in DatagridView it doesn't no problem. Then, a second time around I refresh my datagridview to start again the timer. My Timer doesn't work as what it did when i first load my program to run my timer in datagridview. Any idea how to fix my problem.
I have the following code.
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Dim name As String
Dim number As String
If i < TblContactsDataGridView.Rows.Count - 1 Then
Me.TblContactsBindingSource.MoveNext()
i = i + 1
TblContactsDataGridView.Rows(i - 1).DefaultCellStyle.BackColor = Color.White
TblContactsDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.Blue
name = Me.TblContactsDataGridView.Rows(i).Cells(0).Value.ToString()
number = Me.TblContactsDataGridView.Rows(i).Cells(1).Value.ToString()
Me.TblContactsDataGridView.ClearSelection()
Me.TblContactsDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.LimeGreen
Try
If objclsSMS.sendMsg(Me.port, number, txtMessage.Text) Then
Me.lblStatus.Text = "Message has sent successfully"
Me.lblStatus.Text = "Failed to send message"
End If
Catch ex As Exception
End Try
Else
Dim a As Integer
a = Me.TblContactsBindingSource.Count()
lblStatus.Text = "Message has sent successfully to " & a & " contacts"
Me.DbSMSDataSet.Clear()
End If
End sub
Thanks in advance.
|
|
|
|
|
Joannou H. Fegarido wrote: Then, a second time around I refresh my datagridview to start again the timer.
My Timer doesn't work as what it did when i first load my program to run my timer in datagridview. Any idea how to fix my problem.
What does "does not work" mean? Does it throw an exception? Does it fail silently? Does it compile?
It sounds like there's a difference in initializing (first run), and restarting (second run), probably due to some variable that's not reset. We can't see from the code whether that's the case, since only the code is shown that is run when the timer executes.
..and one could guess that things go bad as soon as "objclsSMS.sendMsg" takes more than the timers' interval. I see that it's called "timer3" - are there more timers in that form? You should consider moving it to a background-thread and updating the UI when the work is done.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you for the quick response in my problem, I appreciate your response. I do not know how to fix it. I'm stock in this problem. Theres no problem on objclsSMS.sendMsg class.. I already tried datagridview and timer only to automatically navigate the record when i click the button. So, when I've done I refresh again the datagridview so that the cursor will be in the first row. The problem is, when i click the button to start again to navigate my record using timer it doesn't happen. Rows nothing navigate automatically.
|
|
|
|
|
Joannou H. Fegarido wrote: I do not know how to fix it. There's usually multiple ways; we will have to find one.
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Dim name As String
Dim number As String
If i < TblContactsDataGridView.Rows.Count - 1 Then Where is i declared? Why is it not reset?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, I think that was the problem. But i do not know how to fix it, please help me to fix. Any help would be appreciated.
|
|
|
|
|
Try something like below; there'll probably be a field with the same name - that needs to be removed.
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Dim name As String
Dim number As String
Dim i As Integer = 0
If i < TblContactsDataGridView.Rows.Count - 1 Then
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you so much for your great help sir. I really appreciate it. I already fixed the problem, the only problem is the i because it doesn't reset to 0 once it done to navigate in datagrid. So in else statement i put i=0 and timer3.stop.
looks like this.
Timer3.Stop()
i = 0
frmStatus.ShowDialog()
Wonderful...
|
|
|
|
|
You're welcome
|
|
|
|
|
Hello,
I am very new to Visual Basic. I have VB 2010 Express and creating my first project, which is a small application that allows a user to create a profile.
One part is where the user can upload a Profile picture.
I can upload a specific picture to the Resources folder and can display it in a picture box by using the following:
PictureBox1.Image = My.Resources.ImageName
That works fine. However, what I want to do is allow the user to click on an "Upload" button, search for any image and have that image load in PictureBox1. I have no clue what code to use or how to write such a code.
Any help would be greatly appreciated.
Thank you.
|
|
|
|
|
|
Hi Richard,
Thank you for your reply.
I am clueless to what you mean. Sorry. Can you give an example of what way that would be done?
I am just learning so any help is appreciated.
Thank you.
|
|
|
|
|
You need to follow that link and read the documentation. You could also try searching the articles section for samples.
Veni, vidi, abiit domum
|
|
|
|
|
You cannot upload a file to the Resources folder. L:ook in the bin\Debug or bin\Release folder in your project in Windows Explorer, NOT in Solution Explorer. Notice there is no Resource folder in there.
Resources are files that are compiled into your resulting executable. You cannot add items to Resources are run-time.
You'll have to change this functionality to put user-uploaded files into a folder your application controls, like CommonApplicationData, and keep track of that filepath in your profile data structure.
|
|
|
|
|
Hi folks,
Thanks so much for the help so far.
I have tried the following, from what I can understand, but it says that
"Await is not Declared. It may be inaccessable due to its protection level"
and:
"CopyToAsync is not a member of System.IO.FileStream"
The code I have tried is:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim StartDirectory As String = "Resource\Start"
Dim EndDirectory As String = "Resource\end"
For Each filename As String In Directory.EnumerateFiles(StartDirectory)
Using SourceStream As FileStream = File.Open(filename, FileMode.Open)
Using DestinationStream As FileStream = File.Create(EndDirectory + filename.Substring(filename.LastIndexOf("Resource")))
Await(SourceStream.CopyToAsync(DestinationStream))
End Using
End Using
Next
End Sub
Thanks in advance for any guidance. As I said, I am totally new.
|
|
|
|
|
Uhhh... Await?? You're a beginner. Don't start trampling through multi-threading code. You're not there yet.
Also, unless you're using VS2012 or 2013 and your project is targeting the .NET Framework 4.0 or above, you don't have access to Await. Even with .NET 4.0, I think you needed to add the "Async Targeting Pack" to your project to get at it.
Now, again, you have a problem. The directory structure you see in Solution Explorer does NOT exist on disk in your compiled application! The Resources folder does NOT exist as far as your code is concerned. You cannot enumerate the files in it because it's a concept that only exists inside Visual Studio and only up to compile-time. Once your project is compiled, the Resources folder essentially does not exist.
|
|
|
|
|
Hi David,
Thank you.
Yes, I created a new folder inside Bin/Debug called Resource, which is the one being used now.
I have no clue about what code to use as I said at the start, which is why I posted here, hoping to get some guidance.
Thanks.
|
|
|
|