|
You don't have a choice. You either rework your strongly typed dataset or you add support code for going through each record in the table and doing the calculation and putting the result in a column in the table.
|
|
|
|
|
Thanks. You gave me an idea for my work.
|
|
|
|
|
I have a dotnet control that i load into a page in the browser. It uses tcp and system.diagnostics(for launching) to communicate with an exe on the PC. The exe can be started up via browser(hidden mode) or a shortcut(visible mode) on the user's pc. If the exe is already started in hidden mode and the user clicks on the shortcut (which would obviously try and start a new instance of the exe), I want the new exe to check if the first exe is running and if running tell the first one to change it's mode and then the new one will just shutdown.
What's the best course of action to get the exes to talk to each other (tcp/api/etc)?
Thanks,
Nathan
|
|
|
|
|
This was just covered a couple of days ago. You're looking for the Mutex class. Search the articles for "single instance" and you'll find examples.
|
|
|
|
|
thanks dave...must of missed it.
|
|
|
|
|
newbie to programming here... I have an Access database that I am binding a TextBox text property to. I would like to have data that is coming in from the database post to the textbox in the (###) ###-#### phone format (in access it is saved as a text type without formatting). I created an event handler for the format and parse event to handle the binding (a copy of which is below). The data is now posting to the textbox as (###) ### - #### without the data (every phone record is filled with the pound sign).
Private Sub PhoneNumberFormat(ByVal sender As Object, ByVal cevent As ConvertEventArgs)
cevent.Value = Format(cevent.Value, "(###) ### - ####")
End Sub
|
|
|
|
|
sabr49 wrote: The data is now posting to the textbox as (###) ### - #### without the data (every phone record is filled with the pound sign).
That's because the format string you've come up with only works with numbers. Since you're storing the phone number as a string, you've going to have to parse that string and insert the characters in the correct place to make a whole new formatted string.
A regular expression might help you in this case.
|
|
|
|
|
Greatly appreciate. Had never used a regular expression b/4 and got it with this regular expression in a jiffy.. Powerful stuff!
Private Sub PhoneNumberFormat(ByVal sender As Object, ByVal cevent As ConvertEventArgs)
Dim strFormatted As String
strFormatted = Regex.Replace(cevent.Value, "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
cevent.Value = strFormatted
|
|
|
|
|
I want to make a project which is called image editor in vb.net. Its functions are
1. File Menu:
Open an image
Save an image after work on that image
MDI-Multiple Document Interface Support
2. Edit Menu:
Where we can cut, copy and paste the image.
3. Windows Menu.
Where we can arrange multiple windows.
4. Other functions
5. Resize an image
6. Transforms an image
7. Rotate an image.
8. Lighting on images
9. Zooming of images
10. Texturing of images.
Aamir Mustafa
|
|
|
|
|
Would mind terribly asking a question we could actually answer! Right now, the response would be "Permission granted!"
What part of this are you having a problem with??
|
|
|
|
|
If you are looking for help in implementing these features in your application, I would suggest you to search for each topic one by one using Google.
Such as if you search for string ‘Resize an Image+Vb.net” it will give you link to many tutorials, articles and newsgroup replies which explains us the process of resizing an image.
I hope in this way you will be able to get basic information about implementing these functionalities. However if you face any specific problem while creating this application, let us know.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
I am currently trying to build some code which handles response times. I have a start time, an end time and a response time. Obviously enough the end time is the start time plus the response time. For example
Start time
12:00
Response time 6 hours
End time
18:00.
My issue is finding out if the two times went over no working hours. Mainly lunchtime 13:00 - 14:00. If I have the start time and end time whats the best way to find out if they ran over a single lunch time or in some cases several lunchtimes?
Any suggestions as to how to code this or any tools in .net that would make this easier to do would be appreciated. Thanks
|
|
|
|
|
i think u should check to see if the timespan between the start time and the no work start time in question is positive, as in the start time is definitely before the no work start time. then if it is positive, check to see if the time span between the end time and the no work start time is also positive, depending on wat u subtracted from the other, then take it from there. if u dont understand this please say so and i can give u more structured pseudo code.
|
|
|
|
|
I think what you have mentioned here is pretty much what I have described but consider the following. If the start time was 09:00. And the response time was 8 hours, the time to respond by would be 17:00.
The thing is this calculation would have gone over lunch time. At which point I need to add 1 additional hour as lunch time is not counted.
DO you understand my problem here?
|
|
|
|
|
Hi Sam,
My confusion is wat the input is and wat the output should be. Could you please clarify wat you are inputting into the system (whether its start or end time, duration or lunch start and end time), also clarify wat the output u want is and we can take it from there.
Sheers
|
|
|
|
|
I have a start time, created when the job is logged. I have a response time, taken from the contract that covers the job. Therefore I have a 'time to respond to by'. Which is the logged time plus the given time span.
Therefore this final time is what my calculations are aiming towards. My issue is how do I check if my two times have gone over a lunch time or not??
|
|
|
|
|
public function getTimeWorked(ByVal StartTime as date, ByVal Duration as TimeSpan, _
ByVal EndTime as date, ByVal LunchStartTime as date, ByVal LunchDuration as TimeSpan) as TimeSpan
dim ActualTimeWorked as TimeSpan
dim TimeWorked as TimeDuration = StartTime - EndTime
if (StartTime < LunchStartTime) and (EndTime > (LunchStartTime + LunchDuration)) then
ActualTimeWorked = TimeWorked - LunchDuration
endif
return ActualTimeWorked
end if
Within the same if statement, u can modify the code to get if the guy finished work DURING lunch period and do the necessary calculations or if he started DURING the lunch period and calculate accordingly.
|
|
|
|
|
I've written the following code..
for updating the dataset....
I don't know how to update the dataset...
Can u help me the correct code..
Here is the Code...
....First Time After Executing SELECT statement...
Dim mycmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter
mycmd.CommandText = qry
mycmd.Connection = conn
da.SelectCommand = mycmd
da.Fill(ds_shifts)
....Now I wanted to Update data in the Dataset...
If ds_shifts.Tables(0).Rows(0).Item(0) = -1 Then
ds_shifts.Tables(0).Rows(0).Item(1) = empid
ds_shifts.Tables(0).Rows(0).Item(2) = "w"
da.Update(ds_shifts) .... this line is giving error.
End If
Happy Day!
|
|
|
|
|
What is the Error ?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Sorry for not giving error details...
The error is...
"System.InvalidOperationException:Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
Happy Day!
|
|
|
|
|
Good morning
This means that you have no Update command specified. look at it this way. you cannot update without the UpdateCommand. for example, if you can try to create everything using a Wizard, just do the drag and drops. in your adapter's Properties there is a update Commnad. it tell the Adapter which column to update, when the update function is invoked as you Did.because you are not using a wizard of which is good, you have to write the updatecommand.
The Updatecommand will like like this.
UPDATE Employee SET Emp_ID = 0918, W = "w"
Hope it Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Initially the SELECT Command was like this...
'----------------------------------------------'
qry = "SELECT ASSSHIFT.Day12,ASSSHIFT.EmployeeId,SHIFTDETAILS.ShiftCode,SHIFTDETAILS.tIn,
SHIFTDETAILS.tOut FROM
ASSSHIFT LEFT JOIN SHIFTDETAILS ON ASSSHIFT.Day12= SHIFTDETAILS.iId
where
ASSSHIFT.EmployeeId=94 AND
ASSSHIFT.MonthNum=10 AND
ASSSHIFT.YearNum=2007
'----------------------------------------------'
Dim mycmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter
mycmd.CommandText = qry
mycmd.Connection = conn
da.SelectCommand = mycmd
da.TableMappings.Add("table0", "ASSSHIFT")
da.TableMappings.Add("table1", "SHIFTDETAILS")
ds_temp.Clear()
da.Fill(ds_temp)
This is my UpdateCommand...
uquery = "UPDATE ASSSHIFT SET day12=3 WHERE EmployeeId=94 AND MonthNum=10 AND YearNum=2007"
Dim comm As New OleDb.OleDbCommand
comm.CommandText = uquery
comm.Connection = myconn ...(Connection Opened)
comm.ExecuteNonQuery()
Now I'm writing update query....
da.Update(ds_shifts)
Now the error is ....
"Update unable to find TableMapping['Table'] or DataTable 'Table'"
Happy Day!
|
|
|
|
|
Hello,
I am trying to create a custom DataGridViewColumn,
This Column has many custom properties (perhaps, of Boolean or String type)
My question is that when i try to set value in the ColumnCollectionUITypeEditor wich open on clicking the Columns() property at design time, these properties doesn't take the new value,
I Tried a lot of methods to solve this problem, but i didn't can to do.
Please, if there is any person know what can i do, write for me the solution.
Thanks...
[Thomas]
|
|
|
|
|
Hi i am trying to find out if tables and fieldnames can start with a number in access. I am writing my Select command for my adapter and I keep getting an error sayig there is a missing operator. My sql is pasted below:
Dim value As String = DateTimePicker1.Value.Date.ToString<br />
<br />
<br />
modbcmdSelect.CommandText = ("SELECT * FROM dayScheduleTemplate,dayTemplateScheduleName, scheduleDate " & _<br />
"WHERE dayScheduleTemplate.dayTemplateScheduleName = dayTemplateScheduleName.24TemplateScheduleName and " & _<br />
"dayTemplateScheduleName.24TemplateScheduleName = scheduleDate.24TemplateScheduleName and scheduleDate.scheduleDate= #" & value & "#")
Mr oizo
|
|
|
|
|
Put brackets around the field name: dayTemplateScheduleName.[24TemplateScheduleName]
---
single minded; short sighted; long gone;
|
|
|
|