Answer Questions
garyvdailyware catcha sqlexception and column
I have an application in C#. I have a table that don't allow null values for a number of fields. I can do an update to the database and catch the SQLException produced if a required field is null (this works fine) What I want to do now is cath the exception, and know what column from the table is null. Can I do it Cannot insert the value NULL into column 'a', table 'b'; column does not allow nulls. INSERT fails. my database is done with ASP.net now i tried to get to col a and make it null by clicking the key but the table is not allowing me, it is a bit field, what would you advice me to do. thanks Within the exception message you will see ...Show All
erikkl2000 Lightweight Activation method like Windows XP
Windows XP activation checks following things in computer and is activated The following 10 hardware characteristics are used to determine the hardware hash: Display adapter SCSI adapter IDE adapter Network adapter media access control address RAM amount range (for example, 0-64MB or 64-128MB) Processor type Processor serial number Hard disk device Hard disk volume serial number CD-ROM/CD-RW/DVD-ROM drive i want to use similar technique like this but a lightweight version. Idea is that once a user logs in my program(custom authentication), it will detect all or some of these and associate login with that computer. That way, that user will only be allowed to login from t ...Show All
Karthikeyan Mahadevan Handling Exception in .NET 2.0 Async web service
Hi, I have problem calling asynchronous web service via the "XXXAsync" method. In .NET 1.1 I can wrap the try...catch block around the "EndXXXX" method and catch any exception that could occur during asynchronous call (such as the internet connectivity problem, blah blah) But in .NET 2.0 there are no "BeginXXX" and "EndXXX" anymore. There is "XXXAsync" instead. In some conditions, when my program call "XXXAsync" method. There is an unhandled exception of type "TargetInvocationException" rises (at "Application.Run(new FormMain());" ) There is a description inside which says "502 Bad gateway". How can I catch such exception which occur during asynchronous call in .NET 2.0 I try to wrap try..catch block around "Application.Run(.." but after ...Show All
Yulia File Name cannot be more than 248
Hi, I am reading file information on NAS Shares using the Directory and FileInfo classes. The problem is that when I try and read the attributes of a file which is inside many folders for ex Share\Folder1\Folder2\..... File I get the exception "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." How do I get the attibutes for the file Thanks in advance, Soni Hi Ryan, this class you posted has the ability to getfiles. Could you tell me what I would need to add to have if getDirectories as well Thanks, Unfortunate ...Show All
janetfan95758 tcplistener and guest login
This is the source file that i am having trouble with. When the user is logged in as guest (built in account guest) the ListenToServer function isnt accepting connections. I tried to impersonate the administrator, everything works fine if logged in as an admin. Please take a look and see what i am doing wrong using System; using System.Collections.Generic; using System.Windows.Forms; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; using System.Runtime.InteropServices; using System.Diagnostics; using System.Security.Principal; namespace client { static class Program { [ StructLayout ( LayoutKind .Sequential, Pack = 1)] ...Show All
Eyso Zanstra Object reference not set to an instance of an object.
I have now got my xml reader working but only when i remove one of the lines from my resultant xml file < xml version="1.0" encoding="utf-8" > If I manually remove this line and then save my file it works ok. the scenerio: A user enters a reg no eg "D1ger" this is then passed to a string and converted into a Url. The information that comes back from the server then gets saved as an xml file. (3rd party subscription service). This then gets read through and placed into text boxes once the user agrees with the data is update to SQL Server. the following is an abstract of the code used: 'declare varibles Dim regno1 As String regno1 = RegNoTxt.Text Dim VRM1(1) As Str ...Show All
NemanjaTheLost Return XML Document using a DataSet?
I have a question about returning an XmlDocument using a Dataset. I seem to be having problems converting it. For eg: public XmlDocument displayXml() { // coding for the DB connection DataSet ds = new DataSet(); ds = generateDataSet(); // another function that returns a dataset; //returns ds after my required process XmlDocument xd = new XmlDocument(); return xd.LoadXml(ds.GetXml()); } This code returns an error: Cannot implicitly convert type 'void' to System.Xml.XmlDocument Please let me know as to where I am going wrong and also if there is a better way to do it You might like to modify last line of your code and return xd instead. XmlDocu ...Show All
Pete R Trace.Refresh() does not refresh filter of listener
I wrote a simple console application with following code in the Main() function: Trace.TraceError("Error output"); Trace.TraceInformation("Information output"); while (Console.ReadLine() != "n") ; Trace.Refresh(); Trace.TraceError("Error output"); Trace.TraceInformation("Information output"); The app.config file has following lines: < xml version="1.0" encoding="utf-8" > <configuration> <system.diagnostics> <trace autoflush="true"> <listeners> <add name="FileTracer" type="System.Diagnostics.TextWriterTraceListener" initializeData="logfile.log"> &l ...Show All
siulm Exception: DataTable internal index is corrupted: '5'. on ...
Hi, I have a problem with bindingsource component in framework 2.0. I have a combobox bound to a bindingsource which is also bound to a dataset with 2 related tables and a datagridview bound to the same bindingsource. What I want to do is : When the selectedindex property of my combobox changes, the corresponding cell value must be changed in the datagridview. But although the value in bindingsource changes, datagridview does not display the new value. That value is displayed after I move the mouse over that cell and make it invalidate its region manually. Another error I caught is the one that you can see as the subject of my post. I do not know why i have that message when I try to change the property of ((DataRowView)mybindi ...Show All
Richard_Mason Benchmark my application
me not sure is that suitable to post this question on this forum, sorry if there not suitable. is there have a way to benchmark my application which done with C#(me using VC# Express) me try to find how much the CPU, memory, banwidth usage, average usage of them after application running a period of time. have some tools to do so thank you and sorry for my poor english thank you so much the article are helpful ^^ You can use performance counters, logs and alerts - Admin Tools\Performance. Here is a very good reference. What you're asking is in Chapter 15, but do try to read as much as you can :). http://www.microsoft.com/downloads/ ...Show All
boyapati out of memory exception in .NET Remoting v2.0 - TCP Channel Binary formatter
Has anyone seen this error I am getting it when the server is supposed to return a dataset with response data. The database may be large but not more than a couple of megabytes. can anyone advise what could be the issue System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. Server stack trace: at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) at System.Text.StringBuilder..ctor(String value, Int32 startIndex, Int32 length, Int32 capacity) at System.Text.StringBuilder..ctor(String value, Int32 capacity) at System.Data.DataSet.SerializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat) at ...Show All
Snickel65 Error on using multiple data reader
Dear All, I have a multiple number of reading done so for the first one I have actually done the reading and close the the reader. Then upon reading the second one I also have close the datareader. But when I run my third reader is gives me this error "There is already an open DataReader accosicated with this Connection which must be closed first.". I have even check using the method IsClosed for the first and second and both shows that is true. What is the possible error. I dont think so that I must open and close my connection always rite. Thanks for your kind replies .net sukbir wrote: myCommandLocal7.Connection = connectionLocal; ...Show All
Vinlui SQLDataReader.GetOrdinal() fails rarely with IndexOutOfRange
Hi everybody, We were developed some Web-Services that run against SQL Server 2000 with SQLDataReader that executing Stored Procedures in the DB. Most of time (95%) everything is running well, but sometimes (when exactly, we don't know) the same WebService that worked 200 times, fail. The code is simple: public string myFunction( int ANumber ) { string strRetVal = null ; SqlDataReader myReader = null ; SqlConnection MyConn = null ;   ...Show All
ThiagoPadilha Web services / Hosted Controls catch 22
We have created a Hosted .Net Control that uses web services to talk to an IIS server. Works great; except behind an Microsoft ISA proxy server that expects authentication. The user gets a 407 Proxy Authentication failed. Through exhaustive searches of the internet we have concluded that the answer should be something like: WebProxy proxy = ( WebProxy ) WebRequest .DefaultWebProxy; proxy.Credentials = CredentialCache.DefaultCredentials; webserviceProxy.Proxy = proxy; However, this approach fails because of a CAS security exception System.Net.WebPermission. This seems to be caused by violation of the Intranet_Same_Site_Access or Internet_Same_Site_Access in the internet and “local intranet” sandbox that we are t ...Show All
goPlayer adding rows in Gridview from javascript
Hi everybody , I am facing a problem while going to add a new row from javascript in gridview. is there any body who has done this. As i have script for deleting the rows from javascript. function delrow(rowindex) { var gridID=document.getElementById( "<%=InjGrid.ClientID %>" ); gridID.deleteRow(rowindex+1); document.getElementById ( "<%=txthidnoofrows.ClientID %>" ).value=gridID.rows.length-1; return false ; } sandesh khare Hi Sandesh, Even i have the same issue. If you have found solution for this problem then please reply back. Thanks and Regards, Shailesh hi sandesh here is the solution to add ...Show All
