Sai A's Q&A profile
.NET Development Unable to Update/Insert a new row into the database...
I am working on a windows project. I created a data base "EAE.mdf" from MS VC# EE, one of the tables of this DataBase is "XmlData". i have created a dataset "EAEDataSet" with the tableadapter "XmlDataTableAdapter" to access the contents of this table. In the project I wanted to insert a few rows from the an XML file. So I have created a data row "xmlDataRow" filled all the columns of this row with the the required data. then added the row to the dataTable "XmlData" using this .DataSet.XmlData.Rows.Add(xmlDataRow); Then called on the update method on the table adapter "XmlDataTableAdapter" table. rowUpdates = this.XmlDataTableAdapter.Update(this.DataSet.XmlData); The above row updates return the exact number of rows added to t ...Show All
.NET Development system.web.mail works, system.net.mail fails
I'm still fighting this changeover to system.net.mail. I have the same error message you showed above. I have a web page that sends the same email text two different ways, or tries to. This one (using real addresses) works: System.Web.Mail.SmtpMail.Send("me@there.xyz", "you@there.xyz", "subject of my email", "body of my email") This one does not: Dim sc As New System.Net.Mail.SmtpClient() Dim message As New System.Net.Mail.MailMessage() sc.Host = "localhost" sc.Port = 25 Dim fromAddress As New System.Net.Mail.MailAddress(txtFromAddress.Text, txtFromName.Text) message.From = fromAddress message.To.Add(Me.txtToAddress.Text) message.Subject = "testing smtp at ...Show All
.NET Development How to access the ASP.NET 2.0 Cache object without HttpContext?
I'm writing a web application that store some data into the application Cache. This cached data is depend on a file. So I create a CacheItemRemovedCallback method to handle the cache removed event. private static void dataRemovedCallback(String key, object value, CacheItemRemovedReason removedReason) { // if the cache Expired, just let it removed. if (removedReason == CacheItemRemovedReason.Expired) return; // if the cache is removed due to dependent file modified, add it back to the cache if (removedReason == CacheItemRemovedReason.DependencyChanged) { // load data from database and cache if again HttpContext.Current.Cache.Add(...); } } But when the program run, NullPointerException is ...Show All
Visual Studio 2008 (Pre-release) 3-Layer Architecture DB Objects
I want to build a 3-Layer architecture based application. In the database layer I want to work with Linq on top of the MS SQL Server. In earlier projects I created my queries in the DB Objects like that: public void statementExecute() { string sSQL; bool bAND = false ; sSQL = "SELECT Person.* " ; sSQL = sSQL + " FROM Person " ; if (existWhereStatement()) { sSQL = sSQL + " WHERE " ; if ( this .PersonID != 0) { sSQL = sSQL + " Person.PersonID = " + this .PersonID.ToString() + " " ; bAND = true ; ...Show All
Windows Forms non-visible column in gridview does not expose data
Hi there, I wonder if you can help me. I am using a gridview in a web project and need to get a value out of the selected row to pass as an argument in the c# code. the gridviewrow exposes the value if the column is set to visible, but I want to hide the value from the UI because it is a foreign key. when I set visible=false I can no longer access the value: code sample columns: hidden <asp:BoundField DataField="state" SortExpression="state" Visible="False" > </asp:BoundField> visible: <asp:BoundField DataField="supplierid" SortExpression="supplierid" ></asp:BoundField> code behind: GridViewRow row = dgRoadpavingRequests.SelectedRow; txt ...Show All
Visual Basic SendARP arithmetic overflow operation
Hi, I'm receving the error "Arithmetic overflow operation" in some computers. They have Ip set by DHCP. This error only happens in 2 or 3 computers (over 100). Dim IpAdd As IPAddress IpAdd = IPAddress.Parse(GetIPAddress) Dim ab(6) As Byte Dim len As Integer = ab.Length ''This Function Used to Get The Physical Address Dim ArpResult As Integer Error when SendArp is called ArpResult = SendARP(CType(IpAdd.Address, Integer), 0, ab, len) mac = BitConverter.ToString(ab, 0, 6) This worked without problems for me: Declare Function SendARP Lib "iphlpapi.dll" (ByVal DestIP As UInt32 _ , ByVal SrcIP As UInt32, ByVal pMacAddr As Byte( ...Show All
Visual Studio Get list of file check in dates programmatically
Hi, Is it possible to get a list of dates when source code was last checked in by code I know we can look through the source safe GUI, but we have several projects. I would like to make an application to search for files that haven't been checked in for a long time so we can find out why. We sometimes have trouble getting all of the code checked in by everyone so we want to find out who isn't checking in the changes they made or if certain projects aren't being checked in for an extended amount of time before its too late. If we are getting ready for a release we will know which projects in VSS were modified and then we would compare the last check in date to the earliest the changes could have been made. Ideally, this would tell us ...Show All
SharePoint Products and Technologies Accessing a SQL Server table using sql authentication as opposed to windows authentication
I have created a pivot table based on a sql server 2005 relational DB connection, with the userid and password stored in the ODC (sql server authentication). The ODC is in the data connection library (DCL) and is approved. I created an Excel sheet with a pivot table based on the ODC. I can refresh this pivot table in Excel 2005, and I have deployed the sheet to the documents library. When accessing the sheet via Excel Services Web access, it displays properly, but refuses to refresh, errorring with : "Unable to retrieve external data for the following connections: xxxxx The data sources may be unreachable, may not be responding, or may have denied you access. Verify that data refresh is enabled for the trusted file location and ...Show All
Visual Studio How to disable the Parameter prompt for Crystal Report using VB.Net
I'm having a problem whereby I can't disable the parameter prompting in VB.Net with the following codes:- Dim crPDV As ParameterDiscreteValue Dim crPFD As ParameterFieldDefinitions Dim crPFL As ParameterFieldDefinition Dim crPV As ParameterValues crPFD = CR.DataDefinition.ParameterFields crPFL = crPFD.Item("paramterName") crPV = crPFL.CurrentValues crPDV = New CrystalDecisions.Shared.ParameterDiscreteValue crPDV.Value = valueToPass crPV.Add(crPDV) crPFL.ApplyCurrentValues(crPV) CrystalReportViewer1.ReportSource = Application.StartupPath & "\TheReport.rpt" CrystalReportViewer1.Show() Any error with the above codes OR do i need to add any additional code(s) that able for me to pass the parameter value direc ...Show All
SQL Server Sproc sorting on float column: works in 2005, not in 2000
Hi Everyone- I inherited this client's app, which is a .NET 2.0 app running under SQL Server 2000 in a shared hosting environment. I am having problems using an ORDER BY clause on the main search stored procedure in that it will properly sort results in SQL Server 2005 on my dev server, but not in 2000 on the production server. In 2000, it seems to be somewhat random, where everyone once in awhile a result that is out of numerical sequence will sneak in. The column on which I am trying to sort is a float column called SquareFoot. Can anyone tell me what is wrong with the stored procedure below that might be causing this This is an existing stored procedure to which I added in the ORDER BY clause. I should note that .NET/SQL Server ...Show All
Smart Device Development Datatable refuses to go out of US date time format C#
This C# does not seem to work: newTable.Locale = new CultureInfo ( "sv-SE" ); // newTable is a Datatable It's still in US datetime format. I've tried lots of different constructs. I working in Windows CE 5.0 I just do a regular fill on the DataTable: try { StringBuilder selCmd = new StringBuilder (); selCmd.Append( "select * from " ); selCmd.Append(tableName); mimerDataAdapter = new MimerDataAdapter (selCmd.ToString(), mimerConnection); table1.Clear(); mimerDataAdapter.Fill(table1); dataGrid.CaptionText = tableName; dataGrid.DataSource = table1; } catch ( Exception ex) ...Show All
.NET Development Native Object Created by C# Custom Marshaler does not Arrive at VB6 COM-Client
Hi all, I have a custom marshaler written in C# that should marshal between .Net-Streams and COM-IStreams. The marshaler is based on a custom marshaler presented by Adam Nathan in his book ".NET and COM - The Complete Interoperability Guide". When the custom marshaler is asked to return the native object an IntPtr is created and returned. I verified that by the message box in the code bellow. Yet, the calling VB6 code reports "Run-time error '424': Object required". The custom marshalling should take place when a .NET-Stream is returned as the return value of a method. Here are some code snippets: // Method of the custom marshaler (StreamMarshaler): public IntPtr MarshalManagedToNative( object Mana ...Show All
Windows Forms Searching for specific text data in the datagridview control
I have been tearing my hair out looking for a way to search all the rows in a selected column of a databound datagridview control for specific text (like a combo box lookup) without success. I am beginning to think that it is not supported and I will have to buy something like vsflexgrid.net. Is there a way to do this without buying a third party control Of course there is. Here is a vb example which will move to the row with the first match as you type in a textbox Imports System.Data.SqlClient Public Class Form1 Dim bs As New BindingSource Dim dt As New DataTable Private Sub Form1_Load( ByVal sender As System. Object , ByVal e As System.EventArgs) Handles MyBase .Load Di ...Show All
Visual Studio Fire a windows form when a shape is added to the designer
Hi guys, What i need to do is to be able to show a custom windows form when a certain shape is added to the designer. That form will allow the user to set some of the shape properties based in information stored in a db. What i need to do is very similar to what appens when you drag a class shape to the designer in the VS ClassDiagrams. Regards Ricardo Francisco Ricardo, You can do this by adding a so called 'rule' which fires when the shape is added. Ceck out this example for adding a rule: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=799447&SiteID=1 Instantiate and show your custom form in the code of the rule. Hope it helps, Gerben. ...Show All
Visual Studio Express Editions Need help please
Hi im new here and in need of some help. i had downloaded Visual Basic 2005 Express edition, and used it for a couple of months, i need it for a college unit i was compleating. but its been ages since i use dit again. now it asks me for a registration key!!!! how and where do i get this registration key i have checked all my e-mail and have recieved nothing, and now im stuck, i have no idea on what to do, because i now want to remove the program from my computer because its taking up 588mb and i dont even use VB anymore. but it wont remove, could this be because of the registration key i realy apreciate all the help everyone is giving me here thank you all greatly BUT!!! the pr ...Show All
