Search Results

Search found 4472 results on 179 pages for 'vb'.

Page 72/179 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Update primary key value using entity framework

    - by lemkepf
    I'm trying to update one value of a compound primary key from within the entity framework and I'm getting this error: "The property 'CustomerID' is part of the object's key information and cannot be modified. " Here is my code: Dim customer As Customer = (From c In db.Customer Where c.CustomerID = "xxx" AndAlso c.SiteKey = siteKey).FirstOrDefault customer.CustomerID = "fasdfasdf" db.SaveChanges() It seems too simple. Is it true you can't update a primary key within the entity framework? I can't find any documentation on the topic. Thanks!

    Read the article

  • Want to bind querystring in postbackurl of imagebutton in gridview?

    - by Sikender
    Hi ,when i try to databind the '<%#Eval("EntryID") %>' to the ImageButton's postbackurl as <asp:ImageButton ID="ibtnEdit" runat="server" CommandName="Edit" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"SystemEmailID")%>' ImageUrl="~/Images/edit-list.gif" PostBackUrl="~/Edit_SyatemEmails.aspx?blogentry=edit&id=<%#DataBinder.Eval(Container.DataItem,"SystemEmailID")%>"/> it's failed, then i updated the code to <asp:ImageButton ID="ibtnBlogEntryEdit" PostBackUrl='"~/admin/BlogEntry.aspx?blogentry=edit&entryid=" & <%# Eval("EntryID") %>' SkinID="edit" runat="server" /> well,the above code has pass the debugging,but failed to databind to the postbackurl,the result as http://localhost/dovoshow/"~/admin/BlogEntry.aspx?blogentry=edit&entryid="%20&%20<%#%20Eval("EntryID")%20%> so,anyonw know how to solve it ,help me thanks

    Read the article

  • Printing an external file in its own printing routine

    - by Yawn.
    I basically have an application that generates reports in a .html file, I use a .html file for the ease of making tables and formatting text. Now I would like to introduce a way of printing the reports from my program. Because I use a .html file, the formatting would not the correct if I was to print it directly from my application (as far as I know). For this reason, I would like to print it just like my web browser would have in order to keep the tabular data intact and the text formatting. Does anyone know a way to do this? Thank you.

    Read the article

  • Hidden/Shown AsyncFileUpload Control Doesn't Fire Server-Side UploadedComplete Event

    - by Bob Mc
    I recently came across the AsyncFileUpload control in the latest (3.0.40412) release of the ASP.Net Ajax Control Toolkit. There appears to be an issue when using it in a hidden control that is later revealed, such as a <div> tag with visible=false. Example: Page code - <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act" %> . . . <act:ToolkitScriptManager runat="server" ID="ScriptManager1" /> <asp:UpdatePanel runat="server" ID="upnlFileUpload"> <ContentTemplate> <asp:Button runat="server" ID="btnShowUpload" Text="Show Upload" /> <div runat="server" id="divUpload" visible="false"> <act:AsyncFileUpload runat="server" id="ctlFileUpload" /> </div> </ContentTemplate> </asp:UpdatePanel> Server-side Code - Protected Sub ctlFileUpload_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles ctlFileUpload.UploadedComplete End Sub Protected Sub btnShowUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShowUpload.Click divUpload.Visible = True End Sub I have a breakpoint on the UploadedComplete event but it never fires. However, if you take the AsyncFileUpload control out of the <div>, making it visible at initial page render, the control works as expected. So, is this a bug within the AsynchUploadControl, or am I not grasping a fundamental concept (which happens regularly)?

    Read the article

  • Current .NET technology stack for a new project? [closed]

    - by jkohlhepp
    If you are going to start a new .NET project, what technologies do you use on top of the base framework? I'm thinking things like ORMs (NHibernate, EF), logging frameworks (Log4Net), IoC containers, rules engines, UI frameworks (Telerik), etc. Are there certain technologies that you always bring in regardless of project type / complexity? Are there certain others that you bring in sometimes when complexity warrants it? This seems like a moving target, and I'm curious what people are using as their "basic setup" nowadays.

    Read the article

  • App.config connection string Protection error

    - by MikeScott8
    I am running into an issue I had before; can't find my reference on how to solve it. Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below: config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) If config.ConnectionStrings.SectionInformation.IsProtected = False Then config.ConnectionStrings.SectionInformation.ProtectSection(Nothing) ' We must save the changes to the configuration file.' config.Save(ConfigurationSaveMode.Modified, True) End If The issue is we had a salesperson leave. The old laptop is going to a new salesperson and under the new user's login, when it tries to to do this we get an error. The error is: Unhandled Exception: System.Configuration.ConfigurationErrorsException: An error occurred executing the configuration section handler for connectionStrings. ---> System.Configuration.ConfigurationErrorsException: Failed to encrypt the section 'connectionStrings' using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: Object already exists. ---> System.Security.Cryptography.CryptographicException: Object already exists

    Read the article

  • Making Infragistics ultrawingrid, desired columns readonly

    - by Amit Ranjan
    I am stucked at the situation where I need to disable few columns of a each row ,except newly added row. That is I have 10 columns in grid and I want first three columns that are binded from the rows coming from db as disabled or read-only, rest are editable. if I add new row then all columns of new row must be enabled until and unless it is saved. I dont have any DataKey or Primary key for my existing row or new row. I have to check for some boolean values like IsNewRow. in my current scenario i am using this code block Private Sub dgTimeSheet_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles dgTimeSheet.InitializeRow ''if either column key is Project, Class or Milestone '' Activation.NoEdit = Disable and Activation.AllowEdit = Enable Dim index As Integer = e.Row.Index If e.Row.IsAddRow Then dgTimeSheet.Rows(index).Cells(PROJECT).Activation = Activation.AllowEdit dgTimeSheet.Rows(index).Cells(SERVICE_ISSUE_CLASS).Activation = Activation.AllowEdit dgTimeSheet.Rows(index).Cells(MILESTONE).Activation = Activation.AllowEdit Else dgTimeSheet.Rows(index).Cells(PROJECT).Activation = Activation.NoEdit dgTimeSheet.Rows(index).Cells(SERVICE_ISSUE_CLASS).Activation = Activation.NoEdit dgTimeSheet.Rows(index).Cells(MILESTONE).Activation = Activation.NoEdit End If CheckRows() End Sub but the problem is that if i click on disabled/readonly rows then newly added rows also gets disabled., which i dont want

    Read the article

  • App.Config Ignored After Pre-Build Event

    - by Jake Hulse
    I have a solution with several projects and several developers, each with their own environment (of course). To manage connection strings between each environment, I have created several app.config files for each environment: app.config.dev, app.config.qa, etc. The pre-build event simply copies the app.config.$(ConfigurationName) to app.config. This pre-build event is done for each project in the solution, and the config string is included in each (including the test project). When I use the pre-build events to manage the app.config files, the connection string cannot be found. I can get the tests to run fine by 2 methods: 1. Do not use the pre-build events to manage the app.config file selection, and do it myself or 2. If I check out app.config and make it writable, then the pre-build events work just fine. We are using Visual Studio 2008. I'm down to my last grey hair here, any ideas? Thanks in advance!

    Read the article

  • How to fix Index out of range exception on idatareader

    - by Phil
    Good morning stack overflow, I have been forced into using the idatareader as opposed to the sqldatareader which has .hasrows available. In my code I am attempting to handle nulls like this: reader = GetContent(pageid) While reader.Read If reader("content") IsNot DBNull.Value Then content = Replace(reader("content"), Chr(38) + Chr(97) + Chr(109) + Chr(112) + Chr(59) + Chr(98) + Chr(104) + Chr(99) + Chr(112) + Chr(61) + Chr(49), "") If reader("id") IsNot DBNull.Value Then contentid = reader("id") End If Else contentid = -1 content = String.Empty End If End While Outputcontent.Text = content I am getting an 'Index Out of Range Exception' here: If reader("content") IsNot DBNull.Value Then The database does 100% contain 'content'

    Read the article

  • How to fix an endpoint/configuration error using WCF in VB.NET

    - by Eric
    I'm working with a small web page that is meant to assist the users of my application. This web page takes a file and sends it to a central server, which then does something with the data and returns a result. I created this application some time ago and am coming back to it recently. I am getting some kind of configuration error right now, although this application used to work. When it stopped working, whenever I ran the page and sent the data to the central server, I would get this error: "Could not find default endpoint element that references contract 'CentralService.ICwCentralService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element." Looking at some other issues on the net, I thought I might have had the answer. The service reference to the endpoint was contained in a separate project from the code that called it, but the configuration file in that project had no information about the endpoint. So, I added these entries to the web.config file in the main project: <system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpEndpoint" closeTimeout="00:01:00" openTimeout="00:0:10" receiveTimeout="01:10:00" sendTimeout="01:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="999999999" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="999999999" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="999999999" maxNameTableCharCount="999999999" /> <reliableSession ordered="true" inactivityTimeout="01:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:22269/CwCentralService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint" contract="CentralService.ICwCentralService" name="wsHttpEndpoint"> <identity> <servicePrincipalName /> </identity> </endpoint> </client> </system.serviceModel> Now, if I run it, I'm still getting an error: "The remote server returned an unexpected response: (400) Bad Request." The strange thing is, though, I took those entries from another project that contacts the central server. That application has no problems contacting the central server using these settings. It's not a web page application, but I don't see how that would require these settings to change. I cannot tell what started causing these errors or when. I assume its something that changed outside of the application (e.g. the libraries referenced) that requires an update to the configuration in the application. I am currently using .NET 3.0 for all of my applications. Any help would be appreciated.

    Read the article

  • ASP.NET Membership with two providers cant use GetAllUsers method

    - by Bayonian
    Hi, I'm using two membership providers. When I declared a following statement Dim allUsers As MembershipUserCollection = Membership.Providers("CustomSqlRoleManager").GetAllUsers Then, it gave me this error message. Argument not specified for paramenter 'totalRecords' of 'Public MustOverride Function GetAllUsers(pageIndex as Integer, pageSize as Integer, ByRef totalRecords as Integer) As System.Web.Security.MembershipUserCollection' Then, I added what it asked for like this : Dim allUsers As MembershipUserCollection = Membership.Providers("CustomSqlRoleManager").GetAllUsers(1, 50, 100) I don't get anything in return. I debugged it and allUsers = Nothing. What's wrong the declaration above? Do I really have to provider the paramenters when calling Membership.Providers("CustomSqlRoleManager").GetAllUsers? Update 1 If, I used the statement below: Dim allUsers As MembershipUserCollection = Membership.Providers("MembershipRoleManager").GetAllUsers(0, 0, totalUser) I got this error message: The pageSize must be greater than zero. Parameter name: pageSize. [ArgumentException: The pageSize must be greater than zero. Parameter name: pageSize] System.Web.Security.SqlMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +1848357 But it works if I provied the pageSize param: Dim pageSize As Integer = GetTotalNumberOfUser() Dim allUsers As MembershipUserCollection = Membership.Providers("MembershipRoleManager").GetAllUsers(0, pageSize, totalUser) This statment Dim pageSize As Integer = GetTotalNumberOfUser() returns the total counted record, it's already round trip to database, just to get the total number of users, because I need to provide the pageSize param value.

    Read the article

  • Illegal Character when trying to compile java code

    - by muckdog12
    I have a program that allows a user to type java code into a rich text box and then compile it using the java compiler. Whenever I try to compile the code that I have written I get an error that says that I have an illegal character at the beginning of my code that is not there. This is the error the compiler is giving me: C:\Users\Travis Michael>"\Program Files\Java\jdk1.6.0_17\bin\javac" Test.java Test.java:1: illegal character: \187 n++public class Test ^ Test.java:1: illegal character: \191 n++public class Test ^ 2 errors

    Read the article

  • Can I set Session timeout for a specified Session variable differently than other Session Variables

    - by Eppz
    I'd like to set the timeout on a specific Session Variable in a .Net web application, but leave other Session variables alone. Is this possible? Example: I have 5 Session Variables Session(var1) Session(var2) Session(var3) Session(var4) Session(var5) I want to set it so that Session(var1) through Session(var4) have a timeout of 8 hours (480 minutes), but Session(var5) has a timeout of 20 minutes. Can it be done?

    Read the article

  • Unit Tests in Visual Studio 2010

    - by Ben
    Hi, i am trying to create a Unit test for a WinForm in a Visual Studio 2010 project. I add a new "Coded UI Test" to my project, open up the code file, then right click and select "Generate Code for Coded UI Test" - "Use Coded UI Test builder". I then start my application up, select "Record" on the UI Map control. I run my tests (in this case simply select a textbox, type in a random value, them click a button). I then select "Generate Code" from the UI Map control which generates the code which the test will use. When running this test, i get the error: Test method HelloWorldTest.CodedUITest1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: TechnologyName: 'MSAA' ControlType: 'Window' Name: 'Form1' ClassName: 'WindowsForms10.Window' --- System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. Does anyone know where i am going wrong? Thanks

    Read the article

  • How to implement facebook like button

    - by vamsivanka
    I am trying to implement facebook like button on my website. The first four lines in the code is already there on my site after the end of the "" tag. To implement the "Like button" i have added the second script (Line five to the end) and ran the application. Its giving me an error as "Microsoft Jscript runtime error:'_onLoad' is null or not an object" Please Let me know. Thanks <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script> <script type="text/javascript"> FB.init("myapikey", "xd_receiver.htm", { "reloadIfSessionStateChanged": true }); </script> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: 'myappid', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script> References: http://developers.facebook.com/docs/reference/plugins/like <fb:like href="http://webclip.in" layout="standard" show-faces="true" width="450" action="like" font="arial" colorscheme="light"/>

    Read the article

  • C# Image Deskew

    - by Brett
    Has anyone seen any image deskew algorithms in c#? I have found: http://www.codeproject.com/KB/graphics/Deskew_an_Image.aspx but unfortunately, it doesn't do very much for images without text. I am specifically trying to auto deskew an image of a book with solid edges, but minimal text. Has anyone seen anything that may be able to do this?

    Read the article

  • LiveJournal xmlrpc date out of order option

    - by Robert Gonzalez
    I am having an issue adding posts to LiveJournal via the xmlrpc api they provide. I want to add entries older than what I have listed on LiveJournal already. But I get a response saying: "You have an entry which was posted at 2009-09-06 18:32, but you're trying to post an entry before this. Please check the date and time of both entries. If the other entry is set in the future on purpose, edit that entry to use the "Date Out of Order" option. Otherwise, use the "Date Out of Order" option for this entry instead." I haven't found an argument for the "Date Out of Order" option using the LJ.XMLRPC.postevent method. Any help would be highly appreciated.

    Read the article

  • How to set tooltips on ListView Subitems in .Net

    - by Ryan
    I am trying to set the tool tip text for some of my subitems in my listview control. I am unable to get the tool tip to show up. Anyone have any suggestions? Private _timer As Timer Private Sub Timer() If _timer Is Nothing Then _timer = New Timer _timer.Interval = 500 AddHandler _timer.Tick, AddressOf TimerTick _timer.Start() End If End Sub Private Sub TimerTick(ByVal sender As Object, ByVal e As EventArgs) _timer.Enabled = False End Sub Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs) If Not _timer.Enabled Then Dim item = Me.HitTest(e.X, e.Y) If Not item Is Nothing AndAlso Not item.SubItem Is Nothing Then If item.SubItem.Text = "" Then Dim tip = New ToolTip Dim p = item.SubItem.Bounds tip.ToolTipTitle = "Status" tip.ShowAlways = True tip.Show("FOO", Me, e.X, e.Y, 1000) _timer.Enabled = True End If End If End If MyBase.OnMouseMove(e) End Sub

    Read the article

  • Linq To Objects Auto Increment Number

    - by Nathan
    This feels like a completely basic question, but, for the life of me, I can't seem to work out an elegant solution. Basically, I am doing a Linq Query creating a new object from the query. In the new object, I want to generate a auto-incremented number to allow me to keep a selection order for later use (named Iter in my example). Here is my current solution that does what I am needing: Dim query2 = From x As DictionaryEntry In MasterCalendarInstance _ Order By x.Key _ Select New With {.CalendarId = x.Key, .Iter = 0} For i = 0 To query2.Count - 1 query2(i).Iter = i Next Is there a way to do this within the context of the linq query (so that I don't have to loop the collection after the query)? Thanks!

    Read the article

  • Trace not working in a .NET DLL loaded from VB6 EXE

    - by Luis
    Hello I have a .NET DLL that writes to the Trace. But seems that when I call my DLL from a VB6 EXE the trace is not working. I have created an myApp.config file in the EXE folder with the trace configuration, but this does not solves the issue. I've also tried creating the Trace objects in code,but doesn't work: Dim _traceSrc as TraceSource= New TraceSource("myTraceSorce") Dim flListener As FileLogTraceListener = New FileLogTraceListener("myFileLogTraceListener") Dim tSwitch As SourceSwitch = New SourceSwitch("mySwitch") tSwitch.Level = _logLevel If I call my DLL from a .NET EXE it works, even if I dont have the app.config in the EXE folder, becusase I set it in code if the config is not found. Thanks

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >