
Ontani
Avatar/Signature-
Posts
123 -
Joined
-
Last visited
About Ontani
- Birthday 08/09/1985
Personal Information
-
Occupation
Student ICT
-
Visual Studio .NET Version
Visual Basic .NET 2002
-
.NET Preferred Language
VB.NET
Ontani's Achievements
Newbie (1/14)
0
Reputation
-
LINQ to Entities does not recognize the method get_Item...
Ontani replied to Ontani's topic in Database / XML / Reporting
I located the problem, something pretty strange: obj.sof_l = (From p In StatsContext.sof_l Where l.id = Locations(myMatch.Groups(1).Value) Select l).FirstOrDefault() changed to: dim location as integer = Locations(myMatch.Groups(1).Value) obj.sof_l = (From p In StatsContext.sof_l Where l.id = location Select l).FirstOrDefault() That fixed the problem, no idea why this is because: obj.sof_l = (From p In StatsContext.sof_l Where l.id = Cint(Locations(myMatch.Groups(1).Value)) Select l).FirstOrDefault() Doesn't work either. -
Hi i'm having some problems using LINQ to Entities Dim obj As New sof_h obj.sof_l = (From p In StatsContext.sof_l Where l.id = Locations(myMatch.Groups(1).Value) Select l).FirstOrDefault() or Dim obj As New sof_h Dim QLocations = From l In StatsContext.sof_l Select l obj.sof_l = QLocations.Where(Function(l) l.id = Locations(myMatch.Groups(1).Value)).FirstOrDefault() Both give me the error: I really have no idea how to fix this problem.
-
Resource converted from Resource File to Local Resource
Ontani replied to Ontani's topic in Windows Forms
I'v tried every possible combination of the image properties and the resx properties. It looks like marble_eater might me the one with a possible workaround here. Thanx -
Resource converted from Resource File to Local Resource
Ontani replied to Ontani's topic in Windows Forms
Anything I tried including your solution resulted the same: resource from resource file gets converted into a local resource -
Hey, I'm creating an class library in wich I have a resource file that contains an image that is going to be used as a backgroundImage of a custom control (Button). So in the Sub New() of my custom Button I added: Me.BackgroundImage = My.Resources.Resources.customImage When I drag the control on a form in my class library the backgroundImage property doesn't hold a reference to the image in the resource file but instead created an local resource (formName.resx) and replaced the property with System.Drawing.Image. Now when I change the property of the control manualy to use the Resources.resx file and the customImage element in that resource. For some reason everything seems to work like a charm. Why on earth would visual studio change my code (where I refer to a resource file) to an local resource. Offcourse this would make me completly lose the advantage of resource files because when changes are made to any of the images I would have to replace them in all the local resource files. Anyone an idea what is going on or how I am able to prevent this from happening. Thanks in advance
-
why not fix such things with javascript? mootools, prototype, scriptaculous?
-
Thanks for the heads up, but as you said the source of the split char is know and not defined by any user input.
-
nope just a default multiline textbox (System.Windows.Forms.TextBox)
-
doesn't work either
-
For some reason my textbox does not scroll to the end of its content. my code: Private Sub txtConsole_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtConsole.TextChanged txtConsole.SelectionStart = txtConsole.TextLength txtConsole.ScrollToCaret() End Sub
-
That seemed to be the problem, Thank you. Now when i don't press an enter after the last line in notepad anything that follows is discarded, maybe its an EOF character or something like that.
-
nothing much to seePD.txt
-
The text is grabbed from notepad at this point, this will be in a later stadium a game console. The length of the text is 23 while there are only 18 characters. So Non-Visible characters are included. 20 or 21 characters would be normal (2 or 3 linebreaks) but 23 is just strange.
-
i have a program that contains the current text in its textbox: Blaaaat Blaaat Blaat Now another program accesses this textbox and reads it out, but some problems occur, with hidden characters messing up some things: aSplitted = strTextBuff.Split(Environment.NewLine) For Each aElement As String In aSplitted Debug.WriteLine(aElement.Length & " - " & aElement) Next the output of this debug is: 7 - Blaaaat 7 - Blaaat 7 - Blaat Not exactly what you would expect, this is what i was expecting: 7 - Blaaaat 6 - Blaaat 5 - Blaat How can i prevent this? What is the problem here? I tried replacing all chrs from 0 to 31 without any success. Anyone an idea? This could be very simple
-
Hey i got a simple tcp server/client application. and i have the listening on the port 6666 in a thread. it keeps listening till the client connects and then it closes the thread. but i want it to keep the thread running so that another client can connect. Const portNumber As Integer = 6666 Dim tcpListener As New tcpListener(portNumber) Dim listenThread As System.Threading.Thread Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Must listen on correct port- must be same as port client wants to connect on. tcpListener.Start() listenThread = New System.Threading.Thread(AddressOf doListen) listenThread.IsBackground = True listenThread.Start() Debug.WriteLine("Waiting for connection...") End Sub Public Sub doListen() 'Accept the pending client connection and return 'a TcpClient initialized for communication. Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient() Debug.WriteLine("Connection accepted.") ' Get the stream Dim networkStream As NetworkStream = tcpClient.GetStream() ' Read the stream into a byte array Dim bytes(tcpClient.ReceiveBufferSize) As Byte networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize)) ' Return the data received from the client to the console. Dim clientdata As String = Encoding.ASCII.GetString(bytes) Console.WriteLine(("Client sent: " + clientdata)) Dim responseString As String = "Connected to server." Dim sendBytes As [byte]() = Encoding.ASCII.GetBytes(responseString) networkStream.Write(sendBytes, 0, sendBytes.Length) Console.WriteLine(("Message Sent /> : " + responseString)) 'Any communication with the remote client using the TcpClient can go here. 'Close TcpListener and TcpClient. tcpClient.Close() Console.WriteLine("exit") End Sub thats my server code this is my client code Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Dim tcpClient As New System.Net.Sockets.TcpClient() tcpClient.Connect("127.0.0.1", 6666) Dim networkStream As NetworkStream = tcpClient.GetStream() If networkStream.CanWrite And networkStream.CanRead Then ' Do a simple write. Dim sendBytes As [byte]() = Encoding.ASCII.GetBytes("Is anybody there") networkStream.Write(sendBytes, 0, sendBytes.Length) ' Read the NetworkStream into a byte buffer. Dim bytes(tcpClient.ReceiveBufferSize) As Byte networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize)) ' Output the data received from the host to the console. Dim returndata As String = Encoding.ASCII.GetString(bytes) Console.WriteLine(("Host returned: " + returndata)) Else If Not networkStream.CanRead Then Console.WriteLine("cannot not write data to this stream") tcpClient.Close() Else If Not networkStream.CanWrite Then Console.WriteLine("cannot read data from this stream") tcpClient.Close() End If End If End If Catch d As Exception MessageBox.Show(d.ToString) End Try End Sub my server debug: Waiting for connection... Connection accepted. Client sent: Is anybody there The thread '<No Name>' (0x105c) has exited with code 0 (0x0). Greetz