Answer Questions
Fluxtah receive in different thread Cause troubles
hi, i wrote a class to send and receive data from a server, i intiate the receive method in a separated thread , when packet arrive i raise event, in the other class i consume it, so i have 2 questions 1. some times the server send packets too fast, and that cause trouble in reading data for the consumer class. some one suggested to use a delegate , for that i raise the event through a delegate but still cuase troubles, so what i suppose to do for that 2. i'm using the lock(this) keyword with the consumer method and thread.sleep() in the receiver now but i'm afraid this might cause losing some packets i thought to use delegate like winForm controls to make it thread safe by invoke it, but i don't know how to write this method ...Show All
Terry Smith Problems with COM
Hi everybody! I'm triyng to develop a simple application that find the avalable COM ports in the computer and then looks for wich one is connected to a modem by writing 254 to the com port and if we get an aswer like 2544 it means that there is a modem in that com, if we get nothing, there isn't. The proble is that I can write 254 to the port, but when I try to read everything freeze. It doesn't show an error, but the applications go death. The application code is the following: Imports System.IO.Ports Imports System.Windows.Forms Imports DescobrirCOM.Constants Public Class Form1 Private Sub Busca_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Busca.Click ' S ...Show All
Rakesh Mishra Namespace confusion
Hi, If I create a new hello-world webservice or similar declared like this: [System.Xml.Serialization. XmlRootAttribute (Namespace = "http://HelloTest/2007/01" , IsNullable = false , ElementName = "HelloResponse" )] - and serializes the response - in the service - theres a nice namespace on the root node like this: < xml version="1.0" encoding="utf-8" > <Hello Response xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd =" http://www.w3.org/2001/XMLSchema " xmlns = http://HelloTest/2007/01 > This is also present when invoked from a browser. But if I add a webservice reference in Visual Studio and call this method, the "xmlns" attribute is gone ex ...Show All
JFoushee xml help please.
I want to read only the text in the following xml into an array. Please help. < xml version="1.0" encoding="utf-8" > <precipitatedata> <precipitate> <abrev>TiN</abrev> <fullname>Titanium Nitride</fullname> <firstelement>Titanium</firstelement> <secondelement>Nitrogen</secondelement> </precipitate> <precipitate> <abrev>TiC</abrev> <fullname>Titanium Carbide</fullname> <firstelement>Titanium</firstelement> <secondelement>Carbon</secondelement> </precipitate> </precipitatedata> I want to read like... abrev[1] = TiN abrev[2] = TiC fullname[1]= Titanium Nitride fullnam ...Show All
robertlamour “The system cannot find the path specified” when calling the web services
I got this error when I call the web service (on a Windows 2003 web server). I didn’t get this error when calling the same web service on my localhost. I am new to .net. Please help!! Is your calling code properly referencing to the web service you are trying to call See if you are missing something while trying calling the web service. Yes. I think so. I also try invoke the web services via IE Browser by entering the required inputs and click the INVOKE button. Again, it works when pointing to my LocalHost; but got the error when pointing to our web server. Where else should I check What error you get when you go via IE Well, if you try accessing the service through IE on the server it ...Show All
Intelligence Bug in CultureInfo.Calender.GetWeekOfYear
I've just developed an application an ran into a bug in the .Net Framework I wrote this code: CultureInfo culture = CultureInfo.CurrentCulture; //It's da-DK int y = culture.Calendar.GetWeekOfYear(new DateTime(2007, 12, 31), CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); Sadly this returned 53, but since december 31, 2007 is a monday it should return 1. /Rasmus Are you sure you are interpreting that right The method will return the # of the week for the entire year. The result in your case is the 53rd week. Why would the last day of December be the first week of the year Are you trying to get the day of the week instead Given your code you are telling .NET that you want the week # for the entire year with the day ...Show All
RoryD Best Practices question.
I want to use typed datasets in the projects that I am working on, however ( and this may just be a symptom of my .Net ignorance ), in order to create the typed dataset I need to specify database and connection info at design time. This can be an issue since I am developing against a test database, so as not to disturb production. What I have done to get around this is to change the connection information at run time, based on values that I am storing in the registry. Are there any better ideas out there for this kind of a scenario I have another question. I want to use typed datasets, but I use different credentials for the database connection depending on the login informations, so how I can cha ...Show All
kperson Request for the permission of type FileIOPermission failed
I have a ASMX Web Service that references a custom DLL we have created. The DLL has a function to read some settings from a XML file that we deploy along with the web service on the web server. When I run the solution on my local machine using the web server built into VS.Net 2005, everything works great. When I deploy it to our Web Server running IIS, I'm getting an error saying it doesn't have proper permissions to read the file. The entire exception message is below, but it looks like it's saying the assembly that caused the failure (my custom DLL - BusinessModel.DLL) is in the MyComputer zone. Shouldn't this mean that the assembly has unrestricted access to the file system I don't have any security specific stuff in my code (no att ...Show All
8- TextBox new value disappears
hello all, I am trying to update records again a certain user. when the user goes on the Update.aspx page, two Textboxs ( txtnewFname, txtnewLname) are filled with the data for that particuler user using a query(SQL Server). Now the user chanes his/her firstname and last name and clicks on Update button. But the old values loaded by the query are again sent to the database and not the modified values. Why does it so happen Anybody please help me! Here is my code: //Page Load Event Private Sub Page_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load 'Put user code to initialize the page here btnsubmit.Attributes.Add("OnClick", "return Che ...Show All
pavvu_kk exporting dataset to Excel
Is it possible to export two datasets into two worksheets of the same Excel file It is possible. It depends on structure of your DataSets and the way you need to do so. In a case of Jet provider or Office Tools you could just loop through the records in both DataSets and then insert records one-by-one. You will be in full control of this process. I have created small component to do this task without Jet or Excel, but to be able to export data from two DataSets in one shot, you need to copy DataTables into one DataSet and the call export. Here's how I'm exporting dataset to Excel: DataSet dataSet = (DataSet)dataObj; GridView GridView1 = new GridView(); GridView1.DataSource = ...Show All
kenniejaydavis In C#, how can I send a binary packet structure with Socket.Send?
Hello, I am trying to send a binary packet structure using Socket.send. I have defined the packet using "StructLayout" and "FieldOffset" in a manner similar to the following: [ StructLayout ( LayoutKind .Explicit, Size = 6)] public class PacketHdr { [ FieldOffset (0)] public short PacketType; [ FieldOffset (2)] public int PacketLength; } After I create an instance of PacketHdr, I need to reference it as "byte [ ]" to send it out using "Socket.Send", since the buffer parameter of Socket.Send is defined as "byte [ ]" as follows: int Socket.Send(byte [ ] buffer, int offset, int size, ... How can I reference the packet as "byte [ ]" This is tri ...Show All
crash33 REQUEST for .NET dev team (at Microsoft)
Hello! I have discussed a bit about controlling the BeginAccept() method of Sockets @ .NET. That's the thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=777364&SiteID=1&mode=1 I simply want to ask you, the developpers of .NET out there at Microsoft, to implement a solution. If it's possible with Windows' API why not make an effort to implement it at .NET This would dramaticly give us the developpers more control on what's going on with our software (basicly security ). I'm sure you got your own reasons but maybe the right person will see this thread and do something about it (maybe in .NET 3 which is about to be released very soon) Anyway I'm very pleased with .NET ! P.S I ...Show All
Lucian Wang access to an excel file
Hello, I would read data from a excel file in 2.0 .net application. How would I proceed I think I should create an ODBC data Source but I don't know how to reuse it from my aplication someone help me. There are several ways to do this 1. Use Jet OLEDB provider. It is probably the fastest way to read the data and you could find some samples of the code here http://support.microsoft.com/kb/306572/en-us http://support.microsoft.com/kb/318373/en-us Possible issues: Since Excel does not have typed columns and each column could contain moxed data types, it could return NULL values for some cells. Another issue could be with the dates - Jet could return you double-precision number instead of t ...Show All
coolarian Problems receiving packets from socket
Hello! I'm new in this forum and in this awesome programming language. I came from Java and I'm actually doing a speed learning in C#. We actually have a single problem that it drives us crazy. We are connecting a serial old device in a TCP/IP terminal server (with a special RJ45-RS232 cable). In fact, the device receives the petitions from the client and sends them the requests to its sender. The device, I said, is and old device that sends the values of patient parameters that we ask it to send. We, then, create a Socket from our computer to the terminal server (is a Lantronix Multiport device server) and make the process of connect to the device, ask the parameters and configure which parameters we want to receive and it starts to send ...Show All
oren Stored Procedure does not exist
Hi, I'm trying to run a stored procedure with the Database class. I have tried two different ways, db.ExecuteDataSet(spName,params) db.LoadDataSet(spName, dataset, New String() {tableName}, arrParams) and both throw the excexption the stored Procedure 'spName' doesn't exist so i decided to run the hands on lab of the data access application block, and guess what it happened again!! the same error. The stored procedures does exists!! and runs perfectly. When I run db.ExecuteDataSet(CommandType.Text, someQuery) it goes just right!! so it is not permisions over the data base (thats what i think). So if anyone can help me here I will really apreciate it. Thanks!! It is definitly accesing the correct dat ...Show All
