Jump to content
Xtreme .Net Talk

Keroleen

Avatar/Signature
  • Posts

    36
  • Joined

  • Last visited

Keroleen's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Can anyone help me out? I have a datagrid. I will enter information into datagrid. The information will go into an MSacess database (OK). I want to have a submit button and/or something that will put the information into text boxes. Context: the information entered are numbers. Hours actually, that correspond to the day of the week (mon-sun). So I would like to when the user enters his/her timesheet hours the hours entered will show up in the textboxes for further processing. Thanks in advance
  2. ???? paramatize query? what do u mean by that? Sorry I am completely NOOB. Do u mind to explain?
  3. For update is it not possible to use this: dap1.Update(das1, "table") I am using a datagrid. I am able to fill my datagrid. I would like to enter information into the datagrid and for it to be entered into the database. Enter information in the cell and press and 'update' button which has the above code in it. But I cant get it to work as i get this error: An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll Additional information: Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.
  4. Im running a simular process here. And I have a question. I have no error message. The only problem, is that when i 'insert' into my Access database, all the fields are NULL, it doesnt 'insert'. Ive already added some error checking, and it says it inserts but not Try Dim sqlStr As String = "INSERT INTO tblTimesheet (jobNumber, jobSubCode, jobProjectName, jobDescription, weekNumber) VALUES (' " & txt_number.Text & "', ' " & txt_subcode.Text & "', ' " & txt_projectname.Text & "', ' " & txt_description.Text & " ', ' " & txt_weeknumber.Text & "')" MsgBox(sqlStr) ** it display the correct statement but in the database it is blank Dim Command5 As New OleDbCommand(sqlStr, connection1) Catch ex As Exception MsgBox("Error") End Try can someone help?
  5. Hello there. I have a few problems that I have been working on for the past month. I have posted here and there about this and that but havent gotten much farther. (In fact gone backwards). I wanna thank all those that i have provided me insight in the past. 1. I have a subroutine that has comboboxes, which is filled via database information. I have figured out to 'fill the boxes'. However since I have added a 'datarow' to the rest of the datacolumns in a subroutine which supposed to put the combobox text inside some textboxes but it will only put the info into some of the boxes. Dim drw1 As DataColumn = DsJobs1.Tables("tblJobs").Columns(jobProjectName) Dim drw2 As DataColumn = DsJobs1.Tables("tblJobs").Columns(jobDescription) Dim drw3 As DataRow = DsJobs1.Tables("tblJobs").Rows(jobNumber) 2. I would like to know how to check for NULLS. Because the application seems to error out when there is no data in a particular cell (which my database has much) I try this: If Not IsDBNull(jobSubCode) Then txt_subcode.Text = ("jobsubcode") Else txt_subcode.Text = "insert into tbl_jobs (jobsubcode) values ("")" End If As well if a record has a NULL, the combobox routine will not work either. 3. I am also trying to dynamically assign into textboxes on this form information from other forms. Is this possible ? I try this : 'Dim string3 As String = "Select monHours, tueHours, wedHours, thuHours, friHours, satHours, sunHours from tblTimesheet where (weeknumber = '+@weeknumber') and (employeecode = '+@employeecode')" ========== Any suggestions for me? Any help is greatly appreciated. Actually I dont know much about programming so if possible could you give a more elementary explaination for me? Thank you so much :)
  6. hi Thanks for the explaination....actually I had the right idea but just wanted to make sure ^_^ As for NULLS, Im actually using Access (i k nowt his is not the ideal, but not my choice) I found a few routines for the null procedure but doesnt seem to work: ie: If Not IsDBNull(xxx) Then txt_xxx.Text = xxx Else txt_xxx.Text = test1.AllowDBNull End If or should i use something like If Not OleDbDataAdapter1.IsDBNull
  7. AGain im still trying to figure out how to configure combo boxes to use with a datagrid. Just wondering theory wize, what is the diff b/c using DataRow and DataColumn? When do i use which? Because arent all the data would be in a 'row'? hmmm 3 months later I am still trying to figure out how to check and allow nulls into my application. The database is filled with many nulls. But Vb.net doesnt like them. I tried the suggestions that was posted but they still get conversion errors. any suggestions guys?
  8. What's the meaning behind this error: Could not determine which columns uniquely identify the rows In my ACCESS database I have all the columns in the table that is it will pull out from My dataset has this: SELECT timesheetcode, friHours, monHours, satHours, sunHours, thuHours, tueHours, wedHours, weekNumber FROM tblTimeSheet ==== Part II Question: Is there a way to dymanically have the program insert parameters in VB.net? The same SQL statement in ACCESS i have it requesting two parameter (employeecode and weeknumber) So the user will enter employee code and a weeknumber and query is drawn upon that. But in the 'real' application, the employeecode and username is already attached to a textbox on that same page. I tried putting where statements such as 'Dim string3 As String = "Select monHours, tueHours, wedHours, thuHours, friHours, satHours, sunHours, employeecode, weeknumber from tblTimesheet where (employeecode = '+@employeecode+')" '(weeknumber = '+@weeknumber') but i dont get the right result. Maybe this function is not possible? I just want using one employeecode and weeknumber to be able to display all records in a dataset. That is where this information will go. thanks
  9. I wanna make a query that will detect the selected week and name of person. I think maybe I put this in my datadapter? SELECT employeeCode, friHours, monHours, satHours, sunHours, thuHours, timeSheetCode, tueHours, wedHours, weekNumber FROM tblTimeSheet WHERE ??????? it will output to a datagrid. I only want a certain WEEK (weeknumber = 200403 for example) But when I do make this procedure with out the WHERE clause and try to do OleDbDataAdapter3.Fill(DsHours1, "qry_timesheet") but it pulls up like all info rather than just one. I already make the query in the access database any suggestions or ideas ?
  10. Thanks for your suggestions guys... Just for anyone who may need this: I solved this using this Dim adate As Date adate = strTemp adate = adate.AddDays(1) txt_sun.Text = (DatePart("d", adate)) adate = strTemp adate = adate.AddDays(2) txt_mon.Text = (DatePart("d", adate)) Its probably not the BEST way but it works for me..:)
  11. Hey guys: Thanks for your suggestions i think that its not using datetime, but rather date I thought of using a Ctype convert b4 but it seems what i need is the actual date and not full date(at full date its working the way i want it to ;) ] IcePlug: DatePart function was as follows: txt_sat.Text = (DatePart("d", txt_beginning))
  12. I have an application where I need to output the actual DATE of the month into a textbox. so I have txt_sat.text = (DatePart("d", "txt_beginning)) where txt_sat is the text box and txt_beginning stores the actually date (ie. 1/1/2003) This gives me what I want. The date of the month..(ie. 27, 2, etc) However I want to date of each day of the week in the same format. I can only get the first day and last day working. for the dates in between I tried txt_wed.text= DateAdd("d", 4, txt_beginning)) this does give the correct date but in the format of 12/1/2002 HOw do I make it so that it extracts only the date (in this case the '1'??? I think it should be the datepart function but if i use that i get this following error Additional Information: Argument 'datevalue' cannot be converted to type 'date' Thanks in Advance :confused:
  13. PS. For initialization...if i use DataColumn rather than DataRow Dim drw2 As DataColumn = DsJobs1.Tables("tblJobs").columns("jobDescription") Rather than Dim drw2 As DataRow = DsJobs1.Tables("tblJobs").rows(jobDescription) seems to get rid of the error but still dont have desirable results. Is there something i need to do with the database to separate the two comboBoxes. I deleted the relationship between then so that my tblSubCode is now orphaned without any relationships to it. But its still linking the subcode to the projectname (when by chance i can get that far). I need it so that the user must choose a project name and a corresponding subcode individually.
  14. Thanks.....I tried that but i still got the same error: An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll Additional information: Cast from type 'DBNull' to type 'String' is not valid. i tried using Dim drw2 As DataRow = DsJobs1.Tables("tblJobs").Rows(jobDescription) If (IsDBNull(jobDescription)) Then txt_description.Text = "" Else txt_description.Text = drw2("jobDescription") End If The Error occurs at txt_description.Text = drw2("jobDescription")
×
×
  • Create New...