|
|
You need to ask something much more specific than "please do my job for me."
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi All...
I will explain what I need in as much detail as possible.
I need some kind of vb script,batch file or whatever to move a file into a separate folder when the program finds a word inside the file.
I have approx 900 files in a folder.One is a vehicle and one is a map for a game.They are mixed together and the only way of telling them apart is by opening each one with my hex editor and search for the word body,which means it is a vehicle.If the "body" word is not found,it is a map.Example of the files: mapname.idf carname.idf
If possible I would like a program to search for the body word and move all those files into a separate folder called vehiclesonly in the same folder where all these .idf files are.The files that do not have the "body" word in it can be left where they are.
Here is a link to one map and one vehicle file for an example:
Thanks a bunch!
Val
|
|
|
|
|
VBScript has a InStr[^] function which you could use to see if a string occurs in another string. Means you'd be looping all files, reading them as a string, checking whether it contains the word, and then performning your action.
I can help out if you have questions on any of those tasks, but I cannot write the code for you.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I have a project in vb.net and sql server 2008R2 , Entity framework .I try to make a model refresh from database.
Before making the refresh , everything was ok , and on datasources I have added with Datasource configuration Wizard some object , and all were ok.
After the refresh , on Data Sources , all my object have a yellow triangle and the expression : "object name.." is no longer available.Verify the class name is correct and the reference to this class is still valid."
I try to insert the object again , I open the DataSource Configuration Wizard - I choose Object -Next.Here I have only app1 and app1.My.But when I expand I can't find any of the objects.
It's strange because on the right side on visual studio, if I click on Class View I can see all the object if I expand App1.
But on wizard there aren't. Before the refresh everything was ok.
I clean the solution and rebuild the solution again .But it's the same situation.
I close and open visual studio several times but nothing.
What can I do ?
Thank you !
|
|
|
|
|
dilkonika wrote: What can I do ? Google, and learn how an EF database is updated.
I have never used EF, mainly because the Wizards tend to hide stuff. That would make me dependent on their idea of how the data should flow and how updates should work.
There's a topic here[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have some code that I use to add information to excel cells in a spreadsheet. I want to also format the cells as I go, but I can't figure out how to get the code for formatting the cells involved. This is what I have:
theRow = theRow + 1
oSheet.Cells(theRow, 1).Value = rs!to
TheTO = rs!to
rs.MoveNext
I figure it should be before "MoveNext" but nothing I place there has any effect other than stopping the loop.
|
|
|
|
|
Hi there,
I want to send a request message to a web service. I must send one xml request per contract. The xml request contains a least one person element. The person information is in a database table.If a contract contains 2 persons in the database then i must include them both in the request.
What i am trying to do is read the person information from the database table and place it into a dataset and then use a for each loop to create each of the persons elements. Unfortunately i am yet unsuccessful.
For example if there is only one person in the database for one specific contract i will send something like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<cre:Contract>
<cre:CONTRACT xsi:type="con:CONTRACT">
<con:ID>1</con:ID>
<pers:PERSON xsi:type="pers:PERSON">
<pers:LASTNAME>John</pers:LASTNAME>
<pers:FIRSTNAME>Dow</pers:FIRSTNAME>
<pers:GENDER>M</pers:GENDER>
<pers:CITIZENSHIP>USA</pers:CITIZENSHIP>
<pers:ADDRESS xsi:type="pers:CC_ADDRESS_INPUT">
<pers:COUNTRY>USA</pers:COUNTRY>
<pers:ZIPCODE>12345</pers:ZIPCODE>
<pers:CITY>NY</pers:CITY>
<pers:STREET>Dummy Street</pers:STREET>
</pers:ADDRESS>
<pers:ROLE xsi:type="pers:ROLE">
<pers:ROLE>Person</pers:ROLE>
</pers:ROLE>
</pers:PERSON>
</cre:CONTRACT>
</cre:Contract>
</soapenv:Body>
</soapenv:Envelope>
If i have two persons i should be able to loop for these person in the dataset and send the following xml request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<cre:Contract>
<cre:CONTRACT xsi:type="con:CONTRACT">
<con:ID>1</con:ID>
<pers:PERSON xsi:type="pers:PERSON">
<pers:LASTNAME>John</pers:LASTNAME>
<pers:FIRSTNAME>Dow</pers:FIRSTNAME>
<pers:GENDER>M</pers:GENDER>
<pers:CITIZENSHIP>USA</pers:CITIZENSHIP>
<pers:ADDRESS xsi:type="pers:CC_ADDRESS_INPUT">
<pers:COUNTRY>USA</pers:COUNTRY>
<pers:ZIPCODE>12345</pers:ZIPCODE>
<pers:CITY>NY</pers:CITY>
<pers:STREET>Dummy Street</pers:STREET>
</pers:ADDRESS>
<pers:ROLE xsi:type="pers:ROLE">
<pers:ROLE>Person</pers:ROLE>
</pers:ROLE>
</pers:PERSON>
<pers:PERSON xsi:type="pers:PERSON">
<pers:LASTNAME>Nick</pers:LASTNAME>
<pers:FIRSTNAME>New</pers:FIRSTNAME>
<pers:GENDER>M</pers:GENDER>
<pers:CITIZENSHIP>USA</pers:CITIZENSHIP>
<pers:ADDRESS xsi:type="pers:CC_ADDRESS_INPUT">
<pers:COUNTRY>USA</pers:COUNTRY>
<pers:ZIPCODE>12345</pers:ZIPCODE>
<pers:CITY>LA</pers:CITY>
<pers:STREET>LA Street</pers:STREET>
</pers:ADDRESS>
<pers:ROLE xsi:type="pers:ROLE">
<pers:ROLE>Person</pers:ROLE>
</pers:ROLE>
</pers:PERSON>
</cre:CONTRACT>
</cre:Contract>
</soapenv:Body>
</soapenv:Envelope>
The code for the "for each" loop is the following:
Dim con As SqlClient.SqlConnection
con = Me.TransactionController.CreateConnection()
con.Open()
Dim sda As New SqlDataAdapter()
Dim cmd As SqlCommand = New SqlCommand("GetPersons", con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@ID", ID)
Dim r As SqlDataReader = cmd.ExecuteReader()
cmd.Connection = con
sda.SelectCommand = cmd
con.Close()
Dim ds As New DataSet()
sda.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
Dim dt As DataTable
Dim dr As DataRow
dt = ds.Tables(0)
Dim person1 As New PERSON
For Each dr In dt.Rows
person1.FIRSTNAME = dr("FIRSTNAME").ToString()
person1.LASTNAME = dr("LASTNAME").ToString()
person1.GENDER = dr("GENDER").ToString()
person1.CITIZENSHIP = RTrim(dr("CITIZENSHIP").ToString())
' Address()
Dim addr1 As New ADDRESS
addr1.STREET = dr("STREET").ToString()
addr1.CITY = dr("CITY").ToString()
addr1.COUNTRY = dr("COUNTRY").ToString()
addr1.ZIPCODE = dr("ZIPCODE").ToString()
person1.ADDRESS = New ADDRESS() {addr1}
'ROLE()
Dim role1 As New ROLE
role1.ROLE1 = ROLE_VALUE.Person
role1.ROLE1Specified = True
person1.ROLE = New ROLE() {role1}
PERSON = New PERSON() {person1}
Exit For
Next dr
ds.Dispose()
End If
''''''--------------------------
Any ideas how to solve my issue?
Thank you in advance.
|
|
|
|
|
|
Yes, patience or MSDN.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
jim haras wrote: Dim person1 As New PERSON
For Each dr In dt.Rows
person1.FIRSTNAME = dr("FIRSTNAME").ToString()
...
You're reading the values from each row and storing them in properties of the same object. If you want to convert each row to a Person object, you're going to have to create a new instance of the Person class for each source row, and store them in a list.
jim haras wrote: PERSON = New PERSON() {person1}
That doesn't look like a valid statement to me.
jim haras wrote: Exit For
You're exiting the loop after the first record. If you want to convert multiple records to Person objects, you'll need to loop through every record.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi there. Thank you for your answer. Can you give me an example?
Thank you.
|
|
|
|
|
Dim people As New List(Of PERSON)(dt.Rows.Count)
For Each dr In dt.Rows
Dim person As New PERSON
person.FIRSTNAME = dr("FIRSTNAME").ToString()
person.LASTNAME = dr("LASTNAME").ToString()
people.Add(person)
Next
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am creating a vb 6.0 project (with sql 2008 as database) on hospital mgmt system. here i m getting 2-3 problems mentioning below:-
1) How to find the total value of different items (i.e. In Pharmacy column i have entered price of different medicines, how to add all medicine's price to find the total price).
2) I need to make a final billing form for patient at the discharging time which will includes all the charges and fees he have to pay (like bed charge,doctor fee,pharmacy bill,tests fee), so how to link the values of all these forms in a separate form.
|
|
|
|
|
Sounds like a generic "order and orderitem" problem.
1) by looping all the stuff that the patient used, and looking up the prices.
2) this is what reports are for.
Kushal Kumar wrote: I am creating a vb 6.0 project No, you shouldn't. Make it VB.NET - it is available for free (vb6 is not free and is no longer sold), and there's a lot more examples and help for VB.NET.
VB6 has been dead for a long time.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Kushal Kumar wrote: I am creating a vb 6.0 project
For f***s sake, WHY ARE YOU USING VB6?? It's been dead and unsupported for quite a while now! As has already been said, get VB.NET and do this in a more modern language.
Kushal Kumar wrote: 1) How to find the total value of different items (i.e. In Pharmacy column i have entered price of different medicines, how to add all medicine's price to find the total price).
You have two options. Either do it in an SQL query or use a For/Next loop to iterate over the items and add each number together. Frankly, if this little part is difficult for you, STOP writing this software right now. A "hospital management system" is not something that should be attempted by someone who doesn't know the basics of what they're doing! YOU could kill someone if you screw up critical sections of code!
Kushal Kumar wrote: 2) I need to make a final billing form for patient at the discharging time which will includes all the charges and fees he have to pay (like bed charge,doctor fee,pharmacy bill,tests fee), so how to link the values of all these forms in a separate form.
Again, you don't have the slightest clue of what you're doing. STOP NOW. Learn how relational databases work. What you're proposing to write is a massive undertaking for someone who doesn't have a clue.
You're not going to get an explanation for the second question simply because it would take an entire book to relate all the concepts to you.
|
|
|
|
|
Just pray that he is not on contract to a hospital near you.
|
|
|
|
|
Yeah, that's what I'm kind of afraid of.
I doubt he's writing this for a U.S. hospital. This seems more like he took a job on vWorker and, like everybody on that site, doesn't have a clue about what he's doing.
|
|
|
|
|
With the number of similar questions being asked, I'm wondering if this is a post-secondary assignment for credit. Many of them quote VB6, so it sounds like that is the installed base.
|
|
|
|
|
Oh wonderful! A bunch of people being ripped off being "taught" out of date skills!
|
|
|
|
|
And will eventually end up quoting peanuts on vWorker!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Good day,
I have a tiff img (img is including pic and text )
Tiff is bigger than 1print page, so I assuming when I call framecount should put 2 pages, but not, always show 1p Page is not completed it showes2/3 1/3 it should go to other page but doesn't show. Sorry I read most of codes what people wrote, but they are not working for me.
If somebody can help will be greatefull
Regards
Drago
|
|
|
|
|
drago11 wrote: when I call framecount
Framecount? On what? The image? It'll always be 1 since it know nothing of the printer that is going to print the image.
The rest of your post is unintelligible. You're going to have to provide quite a bit more detail to your question to get a clear answer.
|
|
|
|
|
Vb net 2010
Tif img
I would like to print that image by calling print preview
Image is larger than one print page.
I cannot get another (second) page where it should be rest of that img.
I'm using
Img.framecount(framedimension .page) where count is always 1, but should be 2.
(To divide 1 tiff img to 2 print pages)
Thanks
Imports System.Drawing.Printing
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.IO
Public Class Form2
Private fileCount As Integer = 0
Private currPage As Integer = 0
Private pCount As Integer = 0
Private currImage As Image
Private Sub vPrintDocument()
Dim vPrintDoc As New PrintDocument
vPrintDoc.DefaultPageSettings.Landscape = False
AddHandler vPrintDoc.PrintPage, AddressOf docPrintPage
AddHandler vPrintDoc.BeginPrint, AddressOf docBeginPrint
Dim i As PrintPreviewDialog = New PrintPreviewDialog
i.Document = vPrintDoc
i.ShowDialog()
End Sub
Private Sub docBeginPrint(ByVal sender As Object, ByVal e As PrintEventArgs)
currPage = 0
currImage = Image.FromFile("C:\out.tif")
pCount = currImage.GetFrameCount(Imaging.FrameDimension.Page)
‘MsgBox(pCount)
End Sub
Private Sub docPrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)
currImage.SelectActiveFrame(Imaging.FrameDimension.Page, currPage)
e.Graphics.DrawImage(currImage, 20, 20)
currPage = currPage + 1
If currPage < pCount Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call vPrintDocument()
End Sub
End Class
modified 28-Sep-14 2:21am.
|
|
|
|
|
That method does not return the amount of pages that the image is printed on; it returns the amount of frames[^] (total images in an animation) in there.
If you want to know how many pages are needed to print something, then you'd have to create a print-preview using the printer-driver.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|