Jump to content
Xtreme .Net Talk

PlayKid

Avatar/Signature
  • Posts

    38
  • Joined

  • Last visited

Everything posted by PlayKid

  1. Dear all, I would like to know how to set certain rules for my database relationships with parent and child tables, such as cascade, restrict.... I am using SQL Server, but I cannot find a way to accomplish this task, I am using VB.Net to design my application, using VB.Net to view my database relationship is okay, but I didn't see anything like Delete Rules, Update Rules, etc for me to select, where should I go? Thank you very much PlayKid
  2. No, this is not what I mean, I am populating the combobox by dataview, and it automatically populate the data onto it, since I am not adding it manually, so your code is not what I want. But thanks for your replying. PlayKid
  3. Dear all, I am trying to filter data by using dataview and display the results on the combo box, but the problem is it displays more than 1 exactly the same results on a combo box, how can I do it to prevent this happned? Thanks PlayKid
  4. Dear all, I am trying to read something from a text file, and each line representing different thing, how do I do that? Thanks PlayKid
  5. Dear all, How do I do that? To prevent user from entering "abcd", the user may only enter "1234"..... Say if the user enter something that's not numeric, then the textbox won't response.... Thanks PlayKid
  6. Yes, I did, but when I clicked the form, the debugger is not responding, what can I do?
  7. Thanks very much, PlausiblyDamp... it works..... it's really help me alot. Thanks PlayKid
  8. This is one of my method, another method is without the shared, still either ways, they still not working. Is there something wrong with my code?
  9. Here is my code: Private Sub DateReturnTP_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateReturnTP.ValueChanged Dim Difference As TimeSpan Difference = DateReturnTP.Value - DateReturnTP.Value DurationText.Text = Difference.TotalDays.ToString End Sub At this line of code: Difference = DateReturnTP.Value - DateReturnTP.Value The problem arises, it says that Operator "-" not defined for types 'Date' and 'Date'.
  10. Thanks for all of your replies, here is my code. In Form 1: Private Sub MorepersonButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MorepersonButton.Click Dim MDIChildMCPersons As New MCPersons MCPersons.SupplierNumber = 2 MDIChildMCPersons.MdiParent = ParentForm MDIChildMCPersons.Show() End Sub In Form2: Public Shared SupplierNumber As Integer Private Sub MCPersons_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label1.Text = SupplierNumber.ToString End Sub And it doesn't doing good. The result is 0 instead of 2.
  11. I tried your method, but it doesn't work, I am using VB.Net.
  12. Thanks for both of your replies, but I have used another method, here is my code, if there is anyone would like to use as well. ClientDataSet1.Tables("Client").Columns("ClientNo").ColumnMapping = MappingType.
  13. Dear all, I am trying to calculate the difference between 2 DateTimePickers' values, and I am unable to calculate the differences in numbers of days, it is fine if they both within the same month, but if the month is changed, the problem arise, it just calculated the differences in day and not the month part. Can anyone help me with this? Thank you very much PlayKid
  14. Joe: That's part of my idea, but since I have 10 combo boxes that do the same tricks, if I entered something on my box, then all other boxes do the same thing, which overwrites my text that I have entered on my combo box. I have changed my code, here is my updated code, but still gives me unwanted results. The results came back to me is, the item was added to the combo boxes successfully, but in my database, it repeated the item 10 times. it's really killing me, been trying figure out the codes for a week already.... Private Sub ActivitiesInformation(ByVal pActivityName As String) Dim drActivities As DataRow dtActivities = dsActivities1.Tables("Activities") drActivities = dtActivities.NewRow If dtActivities Is Nothing Then ActivityNo = 1 Else ActivityNo = dtActivities.Rows.Count End If drActivities("ActivitiyNo") = ActivityNo + 1 drActivities("ActivityProvided") = pActivityName dtActivities.Rows.Add(drActivities) End Sub Private Sub Combo(ByRef pCombo As ComboBox, ByVal dt As DataTable) Dim dr As DataRow If pCombo.Text <> "" Then dr = dt.NewRow dr("SupplierNo") = SupplierNo + 1 If CheckExistanceInComboBox(pCombo) = False Then Call ActivitiesInformation(pCombo.Text) dr("ActivityNo") = ActivityNo + 1 ElseIf CheckExistanceInComboBox(pCombo) = True Then dr("ActivityNo") = pCombo.ValueMember End If dtSupplierActivities.Rows.Add(dr) End If End Sub Private Sub SupplierActivitesInformation() Dim drSupplierActivities As DataRow dtSupplierActivities = DsSupplierActivities1.Tables("SuppliersActivities") Call Combo(ComboBox1, dtSupplierActivities) Call Combo(ComboBox2, dtSupplierActivities) Call Combo(ComboBox3, dtSupplierActivities) Call Combo(ComboBox4, dtSupplierActivities) Call Combo(ComboBox5, dtSupplierActivities) Call Combo(ComboBox6, dtSupplierActivities) Call Combo(ComboBox7, dtSupplierActivities) Call Combo(ComboBox8, dtSupplierActivities) Call Combo(ComboBox9, dtSupplierActivities) Call Combo(ComboBox10, dtSupplierActivities) Call Savechanges(dsActivities1, daActivities) Call Savechanges(DsSupplierActivities1, daSupplierActivities) End Sub
  15. How do I do that? Not really understand your meaning.....
  16. Dear all, I am attempting to do something interesting with the datagrid, when I click a specific row on the datagrid, it open a form and the information that was on that row transferred to the form that just opened. Is it possible to do that? I know that it is possible on VB 6, but how can I do it with VB.Net? Thanks PlayKid
  17. Hi all, I am try to make something that can update my database from my combobox, since I have 10 comboboxes on my form, and each perform the same function and had the same data source. The scenario is that: 1. I have 2 tables that needed to update 2. I need to check whether the string that I typed on my combo box is existed on my database, if not, then add to the database. The problems come in when I am trying to check my combo box, I tried many method, and still not working. Can someone lead me with this? Thanks very much PlayKid Private Sub SupplierActivitesInformation() Dim drSupplierActivities As DataRow Dim c As Control Dim count, countdata As Integer dtSupplierActivities = DsSupplierActivities1.Tables("SuppliersActivities") For count = 1 To 10 For Each c In ProvideActivitiesGroup.Controls If (c.Name = "ComboBox" & CStr(count)) And (c.Text <> "") Then drSupplierActivities = dtSupplierActivities.NewRow drSupplierActivities("SupplierNo") = SupplierNo + 1 ------------------------PROBLEM HERE----------------------------------- dtSupplierActivities.Rows.Add(drSupplierActivities) Call Savechanges(DsSupplierActivities1, daSupplierActivities) End If Next Next count End Sub
  18. Hi all, I am having 2 forms, and I have declared an integer variable in form 1, then I assign something from from2 to that integer value, but it just didnt pass my value, can somebody tell me why??But when I am passing a textbox value, it can be passed. PlayKid
  19. Dear all, Just wonder is it possible to hide any columns in the datagrid? I have read some books, but they didn't say anything about this issue, but is it possible. Thanks PlayKid
  20. PlayKid

    Procedure

    Thanks alot....I figured it out already.....
  21. PlayKid

    Procedure

    Yes, that's what I want, but how can I call that procedure? Can I just say "Call Procedure()"?
  22. PlayKid

    Procedure

    I would like to create a procedure which is fitted for all forms within the program, how can I do that? Thanks PlayKid
  23. Hi all, I am trying to create a program with Client Number, but I want the program to automatically generate an auto number for the Client Table, how can I do that? Note that I am using MSDE Thanks PlayKid
  24. Sorry for my stupidity, since I am a beginner to MSDE, I am really not familiar with the server, therefore I am not really sure what you are talking about? I have searched on the internet about sp_attach_db, but the result that I got from it is similar as what you were saying, but I am really clueless about where to start doing so. I have downloaded a software called EMS MS SQL Manager Lite, coz I saw some websites is saying may use that to do so, but still, I tried, nothing seems to be working to me. Can you maybe walk me through about how to move the database to somewhere else? Thank you very much, PlayKid
×
×
  • Create New...