Search Results

Search found 3307 results on 133 pages for 'distributed datasource'.

Page 52/133 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • DatagridView loses current edit on Background update

    - by yoni.s
    Here's my problem : I have a DataGridView bound to a BindingList of custom objects. A background thread is constantly updating a value of these objects. The udpates are showing correctly, and everything is fine except for one thing - If you try to edit a different field while the background-updated field is being updated, it loses the entered value. Here is a code sample that demonstrates this behavior: (for new form, drop a new DataGridView on:) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplication2 { public partial class Form1 : Form { private BindingList<foo> flist; private Thread thrd; private BindingSource b; public Form1() { InitializeComponent(); flist = new BindingList<foo> { new foo(){a =1,b = 1, c=1}, new foo(){a =1,b = 1, c=1}, new foo(){a =1,b = 1, c=1}, new foo(){a =1,b = 1, c=1} }; b = new BindingSource(); b.DataSource = flist; dataGridView1.DataSource = b; thrd = new Thread(new ThreadStart(updPRoc)); thrd.Start(); } private void upd() { flist.ToList().ForEach(f=>f.c++); } private void updPRoc() { while (true) { this.BeginInvoke(new MethodInvoker(upd)); Thread.Sleep(1000); } } } public class foo:INotifyPropertyChanged { private int _c; public int a { get; set; } public int b { get; set; } public int c { get {return _c;} set { _c = value; if (PropertyChanged!= null) PropertyChanged(this,new PropertyChangedEventArgs("c")); } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion } } So, you edit column a or b, you will see that the column c update causes you to lose your entry. Any thoughts appreciated.

    Read the article

  • SQLite connection pooling with Fluent NHibernate

    - by Groo
    Is there a way to setup SQLite connection pooling using Fluent NHibernate configuration? E.g. equivalent of DataSource=:memory: would be: var sessionFactory = Fluently .Configure() .Database(SQLiteConfiguration.Standard.InMemory) (etc.) Is there something eqivalent to "Pooling=True;Max Pool Size=1;"?

    Read the article

  • Cannot find typenames ("cannot resolve symbol")

    - by dotnetdev
    I have a site in ASP.NET using Telerik AJAX controls. Despite the latest binary being added to the website project, my code (eg myRadGrid.Datasource = "";) shows a red line on type names as they cannot be found for some reason. Can anyone possibly explain why or have experience in this sort of problem? Thanks

    Read the article

  • asp.net repeater returns weird html

    - by emre
    I have a repeater that is supposed to create div tags with their onclick functions from databind. Which is like onclick='<%# "functionname('" + Eval("somestring") +"');" %>' but the single quotes ' after the js func ( and before ) , they become something like ?,= .. I don't understand what's happening. .. the full code is below <div id="dvPager"> <asp:Repeater ID="pagerSorular" runat="server"> <ItemTemplate> <div class='<%# "pageritem pagertext" + ((this.PageNumber == int.Parse(Container.DataItem.ToString())) ? " pagerselected" : "") %>' onclick='<%# "gotopage('" + this.PageName + "', " + Container.DataItem + ");" %>'> <%# Container.DataItem %> </div> </ItemTemplate> </asp:Repeater> </div> and codebehind is: public int PageNumber { get { string strPgNum = Request.QueryString["pg"] as String; if (!String.IsNullOrEmpty(strPgNum)) { int pgnum; if (int.TryParse(strPgNum, out pgnum)) { if (pgnum <= 0) { return pgnum; } else { return 1; } } else { return 1; } } else { return 1; } } } public string PageName { get { string url = Request.Url.ToString(); string[] parts = url.Split(new char[]{'/'}); return parts[parts.Length - 1]; } } public void Doldur(List<SoruGridView> sorulistesi) { gridSorular.DataSource = sorulistesi; gridSorular.DataBind(); /// PagerYap(sorulistesi); } protected void PagerYap(List<SoruGridView> sorulistesi) { List<int> numpgs = new List<int>(); int count = 1; foreach (SoruGridView sgv in sorulistesi) { numpgs.Add(count); count++; } pagerSorular.DataSource = numpgs.ToArray(); pagerSorular.DataBind(); }

    Read the article

  • ASP.net Repeater Control Problem (nothing outputted)

    - by Phil
    I have the following db code in my usercontrol (content.ascx.vb): If did = 0 Then s = "select etc (statement works on server)" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", Data.SqlDbType.Int) x.Parameters("@contentid").Value = contentid c.Open() r = x.ExecuteReader If r.HasRows Then Contactinforepeater.DataSource = r End If c.Close() r.Close() Else s = "select etc (statement works on server)" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", SqlDbType.Int) x.Parameters("@contentid").Value = contentid x.Parameters.Add("@did", SqlDbType.Int) x.Parameters("@did").Value = did c.Open() r = x.ExecuteReader If r.HasRows Then Contactinforepeater.DataSource = r c.Close() r.Close() End If End If Then I have the following repeater control markup in my usercontrol (content.ascx): <asp:Repeater ID="Contactinforepeater" runat="server"> <HeaderTemplate> <h1>Contact Information</h1> </HeaderTemplate> <ItemTemplate> <table width="50%"> <tr> <td colspan="2"><%#Container.DataItem("position")%></td> </tr> <tr> <td>Name:</td> <td><%#Container.DataItem("surname")%></td> </tr> <tr> <td>Telephone:</td> <td><%#Container.DataItem("telephone")%></td> </tr> <tr> <td>Fax:</td> <td><%#Container.DataItem("fax")%></td> </tr> <tr> <td>Email:</td> <td><%#Container.DataItem("email")%></td> </tr> </table> </ItemTemplate> <SeparatorTemplate><br /><hr /><br /></SeparatorTemplate> </asp:Repeater> When I insert this usercontrol into default.aspx with this code: <%@ Register src="Modules/Content.ascx" tagname="Content" tagprefix="uc1" %> and <form id="form1" runat="server"> <div> <uc1:Content ID="Content" runat="server" /> </div> </form> I do not get any error messages but the expected content from the database is not displayed. Can someone please show me the syntax to get this working or point out where I am going wrong? Thanks in advance!

    Read the article

  • Show bit Column as a checkbox column in unbound Datagridview

    - by Name.IsNullOrEmpty
    Dim Comp = From C In db.Table1 _ Select C.Completed, C.Taken, C.Namne Datagridview1.DataSource = Comp Am using the Entity Framework and Columns Completed and Taken are of bit Datatype. When the query results are displayed in the datagridview, these bit columns are returned as of ColumnType Textbox - so i get a Datagridview textbox column with true or false string values. I want to display Completed and Taken as Checkbox columns (either ticked for True or un-ticked for false) but ofcourse i can't do this in EditColumn dialogue because the Datagridview is unbound. how can i change this in code at runtime

    Read the article

  • gridview findcontrol in footer problem

    - by harold-sota
    I have a asp.net grid view with the property ShowFooter="True" and a item template as <FooterTemplate> <asp:DropDownList ID="Contetnt1InsertDropDownList" Width="100%" runat="server" DataSource="<%# GetValueForDropDownCombinationContent() %>" DataValueField="LOOKUP_ID" DataTextField="LOOKUP_NAME" > </asp:DropDownList> </FooterTemplate> in the code behind : Dim ddl As DropDownList = DirectCast(combinationViewGridView.FooterRow.FindControl("Loocup1InsertDropDownList"), DropDownList) in a RowCommand event the cast return a null value. Any ideas??

    Read the article

  • Reporting services and custom library

    - by niao
    Greetings, In my Reporting Services report I've added reference to my custom library. It works fine. I can display the string which is returned from my custom library method as follows: =ClassLibrary1.MyClass.Parse("harry potter") Above code works fine - it should return SQL query based on passed parameters. My question is, how can I use this code in my DataSource. I'm trying to do something like this: SELECT * FROM =ClassLibrary1.MyClass.Parse(@searchedPhrase) But the above code does not work and the error is returned :"Incorrect syntax near ="

    Read the article

  • Enterprise level control of ClickOnce product on corporate network with group policy?

    - by MrEdmundo
    Hi there I'm a developer looking at introducing ClickOnce deployment for an internal .NET Winforms application that will be distributed via the corporate network. Currently the product roll out and updates are handled by Group Policy however I would like to control the updates via ClickOnce deployment now. What I would like to know is, how should I initially roll out the package to make sure that all users have got it. Can I use a combination of Group Policy (the roll out) and then rely on the ClickOnce deployment model for any further updates?

    Read the article

  • Sorting a GridView

    - by Markus
    Hi, I have a question regarding GridView windows forms control. As a datasource, I am using a DataTable object. When the grid view is sorted, the DataTable's row indices are not sorted. In this way, when accessing the DataTable using indices from GridView, I get the unexpected rows. How can this situation be handled?

    Read the article

  • UIPicker EXC_BAD_ACCESS after repeated usage

    - by alexeyndru
    i populate uipicker's datasource from array built with sqlite database stored data. everythiongs works fine.. for a little while. after 6-7 spinnings, the picker freeze, and I get EXC_BAD_ACCESS. debugger indicates the program stopped in the main () function. so, how could this happen? working for a while, and then, suddenly exit like that? thanks

    Read the article

  • Table View Controller Problems

    - by happyCoding25
    Hello, I added a table view into a view in interface builder and now I need to wire it up to some pre-made classes that you can generate in xcode. I set the tableview controller's class to the class in xcode and wired the dataSource and delegate to my table view but the app just crashes. Im not sure how to get data to properly load into my table view when using a tableview in a different view. If anyone knows how to do this any help is appreciated. Thanks

    Read the article

  • struggling to populate lookupEdit problem!

    - by helloise
    I am using the devexpress lookupedit control, and I have set the EditValue property(SocklocationBindingSource - Location). When you click on the black little arrow ON the control itself, the datasource, displaymember and valumember are set. I run my app and see [editvalue is null] in the actual control? What else must i set? What on earth am i doing wrong? I use VS 2009

    Read the article

  • Can I use ext3 as a shared fs if I add a lock manager ?

    - by edomaur
    I need a cluster filesystem for an iSCSI device. The problem is that the servers to which it is connected generate datafiles which must be read by every other servers. Except for the writing and deleting of such files, I do not need a full locking scheme like in OCFS2 or GFS2. So, can I use a distributed lock manager (DLM) on top of an ext3 filesystem or must I use only specialized filesystem ?

    Read the article

  • How to assign class property as display data member in datagridview

    - by KoolKabin
    hi guys, I am trying to display my data in datagridview. I created a class with different property and used its list as the datasource. it worked fine. but I got confused how to do that in case we have nested class. My Classes are as follows: class Category property UIN as integer property Name as string end class class item property uin as integer property name as string property mycategory as category end class my data list as follows: dim myDataList as list(of Item) = new List(of Item) myDataList.Add(new Item(1,"item1",new category(1,"cat1"))) myDataList.Add(new Item(2,"item2",new category(1,"cat1"))) myDataList.Add(new Item(3,"item3",new category(1,"cat1"))) myDataList.Add(new Item(4,"item4",new category(2,"cat2"))) myDataList.Add(new Item(5,"item5",new category(2,"cat2"))) myDataList.Add(new Item(6,"item6",new category(2,"cat2"))) Now I binded the datagridview control like: DGVMain.AutoGenerateColumns = False DGVMain.ColumnCount = 3 DGVMain.Columns(0).DataPropertyName = "UIN" DGVMain.Columns(0).HeaderText = "ID" DGVMain.Columns(1).DataPropertyName = "Name" DGVMain.Columns(1).HeaderText = "Name" DGVMain.Columns(2).DataPropertyName = "" **'here i want my category name** DGVMain.Columns(2).HeaderText = "category" DGVMain.datasource = myDataList DGVMain.refresh() I have tried using mycategory.name but it didn't worked. What can be done to get expected result? Is there any better idea other than this to accomplish the same task? Edited My question as per comment: I have checked the link given by u. It was nice n very usefull. Since the code was in c# i tried to convert it in vb. Everything went good but failed at a point of case sensitive and next one is that i had my nested class name itemcategory and my property name was category. there it arouse the problem. it didn't searched for category but it searched for itemcategory. so confused on it. My Code as follows: Private Sub DGVMain_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DGVMain.CellFormatting Dim DGVMain As DataGridView = CType(sender, DataGridView) e.Value = EvaluateValue(DGVMain.Rows(e.RowIndex).DataBoundItem, DGVMain.Columns(e.ColumnIndex).DataPropertyName) End Sub Private Function EvaluateValue(ByRef myObj As Object, ByRef myProp As String) As String Dim Ret As String = "" Dim Props As System.Reflection.PropertyInfo() Dim PropA As System.Reflection.PropertyInfo Dim ObjA As Object If myProp.Contains(".") Then myProp = myProp.Substring(0, myProp.IndexOf(".")) Props = myObj.GetType().GetProperties() For Each PropA In Props ObjA = PropA.GetValue(myObj, New Object() {}) If ObjA.GetType().Name = myProp Then Ret = EvaluateValue(ObjA, myProp.Substring(myProp.IndexOf(".") + 1)) Exit For End If Next Else PropA = myObj.GetType().GetProperty(myProp) Ret = PropA.GetValue(myObj, New Object() {}).ToString() End If Return Ret End Function

    Read the article

  • Cryastl Reports is not recognizing that a new parameter has been added to the report's stored proc

    - by ann
    i have added another input parameter to a stored proc used by a crystal report. i've had our dba recompile the stp to be sure that the new parameter is cached and "really there". i cannot get my crystal report to recognize the new parameter -- i've tried verifying database and using the Set Datasource Location/Update to re-select the stp. i'm using cr11 against a 2005 sql server db. any other suggestions?

    Read the article

  • How to bind gridview using linq/Entity Framework?

    - by Kay
    I need to bind GridView, I am using this code: ProductDBEntities db = new ProductPDBEntities(); var pro = from u in db.Products where u.PID == 1 select u; if (pro != null) { GridView1.DataSource = pro; GridView1.DataBind(); } and getting this error. System.InvalidOperationException: Sequence contains more than one element Can somebody please tell me what am I doin wrong?

    Read the article

  • JMF. Create new custom streamdatasource

    - by Afro Genius
    Hi there. I am looking to create a means of building a DataSource object (and hence a Processor) that gets data from a stream instead of a file, RTP, and so on. I am writing a module for a much larger application that is meant to transparently transcode audio data. Going through the JMF docs only specify how to create a source from file however I need to be able to create a source from a stream within my application. Any idea where I can start looking?

    Read the article

  • ASP.NET User Control As FilterParameter

    - by Steven
    When adding WHERE-clause parameters in a DataSource, you can specify an existing form control (textbox, dropdown, etc) by selecting "Source: Control" and then picking the "ControlID" from the next dropdown. Can a user-control be configured to appear in the Controls list?

    Read the article

  • Spring transaction management breaks hibernate cascade

    - by TimmyJ
    I'm having a problem where the addition of spring's transaction management to an application causes Hibernate to throw the following error: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.fstrf.masterpk.domain.ReportCriteriaBean.treatmentArms org.hibernate.engine.Collections.processDereferencedCollection(Collections.java:96) org.hibernate.engine.Collections.processUnreachableCollection(Collections.java:39) org.hibernate.event.def.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:218) org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:77) org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135) org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72) org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:905) org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:715) org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) $Proxy92.saveNewReportCriteria(Unknown Source) org.fstrf.masterpk.domain.logic.MasterPkFacade.saveNewReportCriteria(MasterPkFacade.java:134) org.fstrf.masterpk.controllers.ReportCriteriaController.setupReportType(ReportCriteriaController.java:302) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:413) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:134) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:310) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:297) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) I'm using Spring 2.5 and annotations to implement this management. Here is the class containing the saveNewReportCriteria method (which, as can be seen by the stack trace, is causing the error) @Transactional( propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false) public class HibernateReportCriteriaDao implements ReportCriteriaDao{ private HibernateTemplate hibernateTemplate; public Integer saveNewReportCriteria(ReportCriteriaBean reportCriteria) { hibernateTemplate.save(reportCriteria); List<Integer> maxIdList = hibernateTemplate.find("SELECT max(id) from ReportCriteriaBean"); logger.info("ID of newly saved list is: " + maxIdList.get(0)); return maxIdList.get(0); } public void setHibernateTemplate(HibernateTemplate hibernateTemplate) { this.hibernateTemplate = hibernateTemplate; } } Then I added the following sections to my configuration files to tell spring that I am using annotation driven transaction management: <bean id="actgDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/actg" /> <property name="resourceRef" value="true" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="actgDataSource" /> </bean> <tx:annotation-driven/> I'm pretty sure that the de-referencing error is being caused due to the proxy class that Spring AOP creates and uses in order to handle transaction management, but I have no idea how I'd go about fixing it.

    Read the article

  • jboss connection pooling

    - by Web
    I have a question related to Prepared Steatement pooling (across all connections). Here's the config file <datasources> <local-tx-datasource> <jndi-name>JNDI-NAME</jndi-name> <connection-url>jdbc:mysql://<server_name>/<database_name>?useServerPrepStmts=true</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>xxx</user-name> <password>xxxxx</password> <min-pool-size>10</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>20</idle-timeout-minutes> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name> <background-validation>true</background-validation> <background-validation-minutes>5</background-validation-minutes> <prepared-statement-cache-size>100</prepared-statement-cache-size> <share-prepared-statements>true</share-prepared-statements> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml --> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources> It seems that this line: <background-validation-minutes>5</background-validation-minutes> doesn't cause any problems with Prepared Statements, but: <idle-timeout-minutes>20</idle-timeout-minutes> causes that all connections are removed and re-created if there was no traffic for the last 20 minutes. Because of that existing Prepared Statements are removed from the pool of cached Prepared Statements. How to overcome this issue? I have to use idle-timeout-minutes because MySQL server closes the connection after 8h

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >