Jump to content
Xtreme .Net Talk

Jay1b

Avatar/Signature
  • Posts

    647
  • Joined

  • Last visited

1 Follower

About Jay1b

  • Birthday 07/27/1979

Personal Information

  • Occupation
    Analyst Programmer
  • Visual Studio .NET Version
    2003 Professional
  • .NET Preferred Language
    VB.NET

Jay1b's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi I have a form which will have a LOT of fields on it. To make the screen manageable I was going to break these fields down into 6 views using a multiview control. I thought there would of been some way to automatically create these fields as textboxes, so i just needed to lay them out. The closest thing i can find is a detailsview, but this doesnt create them as textboxes. The reason why i wanted them as textboxes is because some of the data is stored as memo, and I was going to arrange these as being 4-5 lines deep. Also I cant seem to find the 'easy' way to populate the textboxes with the data. I can do this in code easily enough, but surely there must be a better way? Thanks
  2. Well by the looks of it, its just the program then. I dont think there is anything more to be said really....
  3. Dont know then...
  4. The main factor is one which you failed to mention. The amount of memory. Ideally VB sits happiest on 1 GB of RAM, especially if you're using 2005. I run it on 512 mb at work, its usable but rather slow.
  5. Hi I'm fairly new to using 2005, both VB and SQL Server Express. I'm trying to create a program which talks to a database on a server for my friends business (big favour!). His company has about 7 people that work there and each of them will have a copy of the VB app installed which will interface with the database. Personally i have quite a bit of experience with standalone VB apps, but i've never really approached anything of this size before, but I'm trying doing this as a) a favour to my friend and b) to learn VB and Sequel a little better as i'm looking to change my job in a few months time. There are no full time IT staff there, any backups will need to be either done automatically or by an office administrator with limited IT skills. I'm not sure how true this is, and i've had no luck proving or disproving it by searching the web. But I heard a rumour that VB 2005 can create and access a 'file' SQL Server 2005 database, which consists of some files, with no installed software or running services. Could somebody please clarify whether this is correct or not? Also I would be very grateful if anybody could make any recommendations upon how they think I should setup the database, with regards to 'file' or running, or backup options etc. Well really any comments at all would be very helpful. Thanks for reading this. Jamie.
  6. Yes I am using 2005. I did actually look at that event, but it still fired when the data was loaded (although apparently it shouldnt do accordingly to that link). However looking at it again made me spot the richtextbox.modified. After setting this to false after loading i can use this just like i was the bhaschanged variable, and it looks so much more readable as well! So thank you :)
  7. Hi I have a richtextbox with a textchanged event. This event fires when the text box is first loaded with data, understandably. This is the code: Private Sub rtfText_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtfText.TextChanged bHasChanged = True End Sub I dont want bHasChanged to be set to true, upon loading, just when the user changes something. This value is then checked upon closing, and uses it to determine whether to prompt about saving changes. I can solve this by having a 'bFirstLoad' like below: Dim bFirstLoad as boolean = True Private Sub rtfText_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rtfText.TextChanged If bFirstLoad Then bFirstLoad = False Else bHasChanged = True End If End Sub This will solve the problem, but it just seem unprofessional to me, is there a better way of doing this? Thanks.
  8. Well i've found out its the dataset thats not being updated. Which isnt an XML problem so i'll post this in the main area.
  9. Hi I have a typed dataset call dsOptions with a table called dtOptions. The form has a datagridview on it with the datasource set to the 'DtOptionsBindingSource1' and no datamember. When this is assigned the columns are displayed on the datagridview. I've also tried is as the datasource equal dsOptionsBindingSource1 and the data member set to dtOptions. I then load the program, type in some data and then press a button which calls the following. Dim myXmlWriter As New System.Xml.XmlTextWriter("hey.xml", System.Text.Encoding.Unicode) DsOptions.WriteXml(myXmlWriter) DsOptions.WriteXml("hey.txt") DsOptions.WriteXml("heynoschema.txt", XmlWriteMode.IgnoreSchema) myXmlWriter.Close() However non of the above options actually output the full XML and data. Instead i just get the following. <?xml version="1.0" standalone="yes"?> <dsOptions xmlns="http://tempuri.org/dsOptions.xsd" /> But thats it. Can someone please tell me what i'm doing wrong? Thanks Jay
  10. Its a string compiled below. Public sHeader As String 'Holds Message Header Public sNumMessage As String 'Holds No. of Messages Public sNumDestination As String 'Holds No. of Destinations Public sNumSigns As String 'Holds Sign Numbers Public sMessHigh As String 'Holds Message High Public sMessLow As String 'Holds Message Low Public sMessText1 As String 'Holds Message Text for line 1 Public sMessText2 As String 'Holds message text for line 2 Public sMessRolling As String 'Holds rolling string Public sMessLargeRolling As String Public bytChecksum As Byte 'Holds Message Checksum Public Shared sMessage As String 'String to hold all of the above Public sEsc As String 'Holds Escape ASCII Character Public sForeColorStr As String 'holds foreground colour of text Private Sub ................................ 'set escape string sEsc = Chr(&H1BS) bSocketInUse = False ' initialise to red text on black background sForeColorStr = Chr(27) & "[31;40m" Dim strMessage As String = "" Dim strEsc As String = Chr(&H1BS) 'Holds Escape ASCII Character sHeader = Chr(&H99S) sNumMessage = Chr(&H1S) sNumDestination = Chr(&H1S) sNumSigns = Chr(&H1S) sMessHigh = Chr(0) sMessText1 = strEsc & "[2J" & strEsc & "[1;1H" & sForeColorStr & "0937" sMessLow = Chr(Len(Trim(sMessText1)) + Len(Trim(sMessText2))) 'build message for transmission sMessage = sHeader & sNumMessage & sNumDestination & sNumSigns & sMessLow & sMessHigh ' this is the message header stuff sMessage = sMessage & sMessText1 'add text for top line ' & sEsc & "[4x" bytChecksum = 0 ' update checksum using each byte of the message For i As Integer = 1 To Len(sMessage) bytChecksum = RotateLeft(bytChecksum) bytChecksum = bytChecksum Xor Asc(Mid(sMessage, i, 1)) Next ' do one further rotation bytChecksum = RotateLeft(bytChecksum) ' and append the checksum to the message sMessage = sMessage & Chr(bytChecksum)
  11. Yes its the same piece of code, i just comment out either Dim b() As Byte = System.Text.Encoding.ASCII.GetBytes(sMessage) or Dim b(sMessage.Length - 1) As Byte For i As Integer = 0 To sMessage.Length - 1 b(i) = Asc(sMessage.Substring(i, 1)) Next
  12. Hi For those of you that saw the other thread, i've managed to find out why it wasnt working and find a work around, but i dont know why one works and not the other. Could someone have a look and tell me what they think please? This is the original code. It was largely working fine, but the first char was chr(153) or Hex value 99. It would convert this into a ?, hex value 3F or Chr(63). I'm guessing it was reading the first character from the string as a ? as its an unprintable symbol, and then outputting this to an actual ? in the conversion. mobjClient = New TcpClient("172.28.46.27", 3500) Dim b() As Byte = System.Text.Encoding.ASCII.GetBytes(sMessage) Dim s As IO.Stream = mobjClient.GetStream s.Write(b, 0, b.Length) s.Flush() s.Close() However I tried the change below (ok so my boss did, who has never used .Net before) and almost annoyingly it worked. mobjClient = New TcpClient("172.28.46.27", 3500) Dim b(sMessage.Length - 1) As Byte For i As Integer = 0 To sMessage.Length - 1 b(i) = Asc(sMessage.Substring(i, 1)) Next Dim s As IO.Stream = mobjClient.GetStream s.Write(b, 0, b.Length) s.Flush() s.Close() Can someone please tell me why the first piece of code didnt work but the second did? Why could it not convert it correctly as part of a string, but it could byte by byte. Obviously its working, which i'm happy about, but i would like to know why if anyone can help please? Thanks
  13. I've found a work around, but i dont know why the work around actually works. But as its different i'll post that in a new thread.
  14. Well i'm still stuck on this :( I created another program to listen to what is being sent through the port and output the characters in hex format. I then found out, that my sockets were working fine, but they are sending different escape characters to the port then the winsock one is. So as mentioned above i've tried using different encoding methods. This is what is returned under various encoding (i've left out the ones which were vastly different). winsock - 991111E01B5B324A1B5B313B31481B5B33313B34306D4A6F696E74205465737420332A System.Text.Encoding.UTF8.GetBytes(sMessage) - E284A21111E01B5B324A1B5B313B31481B5B33313B34306D4A6F696E74205465737420332A System.Text.Encoding.ASCII.GetBytes(sMessage) - 3F1111E01B5B324A1B5B313B31481B5B33313B34306D4A6F696E74205465737420332A With the obvious exception of the winsock one, they both use the below code. mobjClient = New TcpClient("172.28.46.27", 3500) Try Dim b() As Byte = System.Text.Encoding.ASCII.GetBytes(sMessage) Dim s As IO.Stream = mobjClient.GetStream s.Write(b, 0, b.Length) s.Flush() s.Close() Catch ex As Exception MsgBox(ex.Message) End Try Can anybody see why this is happening please? If its unavoidable, can you think of a workaround? (Short of using Winsock). Thanks
  15. Thanks Nate, but I dont think that would apply to Sockets though would it?
×
×
  • Create New...