Search Results

Search found 24399 results on 976 pages for 'datatable select'.

Page 4/976 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • VB.Net Linq Datatable Exists

    - by LarsH
    I would like to use Linq instead of below function : Friend Function IsCollectionInTable2(ByVal apps As DataTable, ByVal collectionId As String) As Boolean For Each row As DataRow In apps.Rows If row("CollectionId").ToString = collectionId Then Return True Next Return False End Function The best I can do is below: Friend Function IsCollectionInTable(ByVal apps As DataTable, ByVal collectionId As String) As Boolean Return (From row In apps.AsEnumerable() Where (row.Field(Of String)("CollectionId") = collectionId) Select row.Field(Of String)("CollectionId")).Count > 0 End Function I would like to use Exists or Any in above function. Performance could be an issue,

    Read the article

  • Alternatives of Datatable

    - by mavera
    In my web application, I have a dynamic query that returns huge data to datatable, and this query is often recalled with different parameters. So database is exhausted. I want to get all record with no parameters to an object, and perform queries (may be with linq) on this object. So database will not be exthausted. Which objects can be used instead of datatable?

    Read the article

  • Usar un Datatable como fuente de datos para un GridView

    - by Jason Ulloa
    Es común ver en los foros, preguntas sobre como llenar un datatable para luego, ponerlo como fuente de un GridView. En nuestro próximo ejemplo, mostraremos lo sencillo que puede ser y la poca cantidad de código que es requerida: using (SqlConnection c = new SqlConnection("conectionstring")) { c.Open(); // Crear un nuevo DataAdapter using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM table", c)) { // Usar un DataAdapter para llenar el DataTable DataTable t = new DataTable(); a.Fill(t);   gridView1.DataSource = t; gridView1.DataBind();   } }

    Read the article

  • <rich:datatable> and <rich:datascroller> problem

    - by Bariscan
    Hi all, I am developing a Seam-Jsfv1.2-EJB3 web app. I have a datatable and checkboxes in each row. Moreover, I have a datascroller at the bottom of my table as well. My problem is when I click the next page number from the scroller, the selected checkboxes at the first page of the datatable is gone. I mean, even if they were selected, clicking the next page make them deselected. I see it by going back to the first page again by clicking the scroller. Do you have any idea about that problem? In order to clearify my case, I attached my code below: <rich:dataTable id="apiV2ProductList" rows="10" var="_apiV2Product" value="#{apiV2ProductList.resultList}" rendered="#{not empty apiV2ProductList.resultList}" reRender="ds"> <rich:column> <f:facet name="header"> <h:selectBooleanCheckbox id="selectionCheckAll" onclick="selectAll()" /> </f:facet> <h:selectBooleanCheckbox id="selectionCheck" onclick="increase(this)" value="#{_apiV2Product.selectValue}" > </h:selectBooleanCheckbox> </rich:column> ... <f:facet name="footer"> <rich:datascroller id="ds" renderIfSinglePage="false"> </rich:datascroller> </f:facet> Many thanks in advance. Baris

    Read the article

  • Printing a DataTable to textbox/textfile in .NET

    - by neodymium
    Is there a predefined or "easy" method of writing a datatable to a text file or TextBox Control (With monospace font) such as DataTable.Print(): Column1| Column2| --------|--------| v1| v2| v3| v4| v5| v6| Edit Here's an initial version (vb.net) - in case anyone is interested or wants to build their own: Public Function BuildTable(ByVal dt As DataTable) As String Dim result As New StringBuilder Dim widths As New List(Of Integer) Const ColumnSeparator As Char = "|"c Const HeadingUnderline As Char = "-"c ' determine width of each column based on widest of either column heading or values in that column For Each col As DataColumn In dt.Columns Dim colWidth As Integer = Integer.MinValue For Each row As DataRow In dt.Rows Dim len As Integer = row(col.ColumnName).ToString.Length If len > colWidth Then colWidth = len End If Next widths.Add(CInt(IIf(colWidth < col.ColumnName.Length, col.ColumnName.Length + 1, colWidth + 1))) Next ' write column headers For Each col As DataColumn In dt.Columns result.Append(col.ColumnName.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() ' write heading underline For Each col As DataColumn In dt.Columns Dim horizontal As String = New String(HeadingUnderline, widths(col.Ordinal)) result.Append(horizontal.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() ' write each row For Each row As DataRow In dt.Rows For Each col As DataColumn In dt.Columns result.Append(row(col.ColumnName).ToString.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() Next Return result.ToString() End Function

    Read the article

  • How to select and deselect checkbox field into the GridView

    - by SAMIR BHOGAYTA
    //JavaScript function for Select and Deselect checkbox field in GridView function SelectDeselectAll(chkAll) { var a = document.forms[0]; var i=0; for(i=0;i lessthansign a.length;i++) { if(a[i].name.indexOf("chkItem") != -1) { a[i].checked = chkAll.checked; } } } function DeselectChkAll(chk) { var c=0; var d=1; var a = document.forms[0]; //alert(a.length); if(chk.checked == false) { document.getElementById("chkAll").checked = chk.checked; } else { for(i=0;i lessthansign a.length;i++) { if(a[i].name.indexOf("chkItem") != -1) { if(a[i].checked==true) { c=1; } else { d=0; } } } if(d != 0) { document.getElementById("chkAll").checked =true; } } } //How to use this function asp:TemplateField input id="Checkbox1" runat="server" onclick="javascript:SelectDeselectAll(this);" type="checkbox" / /HeaderTemplate /asp:GridView columns asp:TemplateFieldheadertemplate input id="chkAll" runat="server" onclick="javascript:SelectDeselectAll(this);" type="checkbox" / /HeaderTemplate

    Read the article

  • DataTable.Select Behaves Strangely Using ISNULL Operator on NULL DateTime Column

    - by Paul Williams
    I have a DataTable with a DateTime column, "DateCol", that can be DBNull. The DataTable has one row in it with a NULL value in this column. I am trying to query rows that have either DBNull value in this column or a date that is greater than today's date. Today's date is 5/11/2010. I built a query to select the rows I want, but it did not work as expected. The query was: string query = "ISNULL(DateCol, '" + DateTime.MaxValue + "'") > "' + DateTime.Today "'" This results in the following query: "ISNULL(DateCol, '12/31/9999 11:59:59 PM') > '5/11/2010'" When I run this query, I get no results. It took me a while to figure out why. What follows is my investigation in the Visual Studio immediate window: > dt.Rows.Count 1 > dt.Rows[0]["DateCol"] {} > dt.Rows[0]["DateCol"] == DBNull.Value true > dt.Select("ISNULL(DateCol,'12/31/9999 11:59:59 PM') > '5/11/2010'").Length 0 <-- I expected 1 Trial and error showed a difference in the date checks at the following boundary: > dt.Select("ISNULL(DateCol, '12/31/9999 11:59:59 PM') > '2/1/2000'").Length 0 > dt.Select("ISNULL(DateCol, '12/31/9999 11:59:59 PM') > '1/31/2000'").Length 1 <-- this was the expected answer The query works fine if I wrap the DateTime field in # instead of quotes. > dt.Select("ISNULL(DateCol, #12/31/9999#) > #5/11/2010#").Length 1 My machine's regional settings is currently set to EN-US, and the short date format is M/d/yyyy. Why did the original query return the wrong results? Why would it work fine if the date was compared against 1/31/2000 but not against 2/1/2000?

    Read the article

  • DataTable DataRow Select String with Quotation Marks

    - by RBrattas
    Hi, My string include quotation mark; the select statement crash. vm_TEXT_string = "Hello 'French' People"; vm_DataTable_SELECT_string = "[MyField] = '" + vm_TEXT_string + "'"; DataRow[] o_DataRow_ARRAY_Found = vco_DataTable.Select (vm_DataTable_SELECT_string); I cannot use this statement: string filter = "[MyColumn]" + " LIKE '%" + SearchWord + "%'"; I found string format: DataRow[] oDataRow = oDataSet.Tables["HasDiseas"].Select ( string.Format ( "DName='{0}'", DiseasListBox.SelectedItem.ToString () ) ); Any suggestion to selecta string with quotation mark? Thank you, Rune

    Read the article

  • Ruby on Rails DataTable now working.

    - by Nimroo
    [Ruby on Rails DataTable guide][1]https://github.com/phronos/rails_datatables/blob/master/README.md I"m following the above and have installed the git plugin as well. All i'm getting is the <%= datatable() % returning " <script type="text/javascript"> $(function() { $('#expenses').dataTable({ "oLanguage": { "sSearch": "Search", "sProcessing": 'Processing' }, "sPaginationType": "full_numbers", "iDisplayLength": 25, "bProcessing": true, "bServerSide": false, "bLengthChange": false, "bStateSave": true, "bFilter": true, "bAutoWidth": true, 'aaSorting': [[0, 'desc']], "aoColumns": [ { 'sType': 'html', 'bSortable':true, 'bSearchable':true ,'sClass':'first' },{ 'sType': 'html', 'bSortable':true, 'bSearchable':true },{ 'sType': 'html', 'bSortable':true, 'bSearchable':true },{ 'sType': 'string', 'bSortable':true, 'bSearchable':true ,'sClass':'last' } ], "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( ); $.getJSON( sSource, aoData, function (json) { fnCallback(json); } ); } }); }); </script>". My .html.erb looks like this: <% @page_title="User Page"%> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <%=javascript_include_tag "jquery.dataTables" %> <%=stylesheet_link_tag "jquery-ui-1.9.2.custom" %> <script> $(function() { $( "#tabs" ).tabs(); }); </script> <% if current_user %> <div id="tabs"> <ul> <li><a href="#tabs-1">Expenses</a></li> <li><a href="#tabs-2">Accountant</a></li> <li><a href="#tabs-3">Requests (<%[email protected]%>)</a></li> </ul> <div id="tabs-3"> <p> <% if @requests.count != 0 %> <h2> Accountant Requests </h2> <table > <tr> <thead> <th>First Name</th> <th>Last Name</th> <th>Email Address</th> <th>Accept</th> <th>Reject</th> </thead> </tr> <% @requests.each do |request| %> <tr> <td><%= request.accountant.first_name %></td> <td><%= request.accountant.last_name %></td> <td><%= request.accountant.email %></td> <td><%= link_to 'accept', confirm_accountant_path(:accountant_id => request.accountant_id) %></td> <td><%= link_to 'Edit', edit_expense_path(request) %></td> </tr> <% end %> </tbody> </table> <% else %> <h4> You have no pending requests <h4> <% end %> </p> </div> <div id="tabs-2"> <p> <% if @accountants.count != 0 %> <h2> Accountant Info </h2> <table> <tr> <th>First Name</th> <th>Last Name</th> <th>Email Address</th> </tr> <% @accountants.each do |accountant| %> <tr> <td><%= accountant.first_name %></td> <td><%= accountant.last_name %></td> <td><%= accountant.email %></td> </tr> <% end %> </table> <% else %> <h4> Add Accountant <h4> <p> You don't have an accountant yet, perhaps consider adding one by e-mail </p> <%= render 'add_accountant_form' %> <% end %> <% end %> </p> </div> <div id="tabs-1"> <p><% if current_user %> <h4> Submit new expense </h4> <%= render 'expenses/form' %> <% columns = [{:type => 'html', :class => "first"}, {:type => 'html'}, {:type => 'html'}, {:type => nil, :class => "last"}] %> <%= datatable(columns, {:sort_by => "[0, 'desc']", table_dom_id:"expenses" }) %> <table id="expenses" class="datatable"> <thead> <tr> <th>Entry Date</th> <th>Last Update</th> <th>Amount</th> <th>User</th> <th>Receipt</th> <th></th> <th></th> </tr> </thead> <% @expenses.each do |user_expense| %> <tbody> <tr> <td><%= user_expense.created_at %></td> <td><%= user_expense.updated_at %></td> <td><%= user_expense.amount %></td> <td><%= user_expense.user.username %></td> <% if !user_expense.receipt_img.nil? %> <td><%= image_tag user_expense.receipt_img.url(:thumb) %></td> <% else %> <td>Future Button Here</td> <% end %> <td><%= link_to 'Show', user_expense %></td> <td><%= link_to 'Edit', edit_expense_path(user_expense) %></td> </tr> </tbody> <% end %> </table> <% end %></p> </div> </div>

    Read the article

  • DataTables warning (table id = 'example-advanced'): Cannot reinitialise DataTable while using treetable and datatable at the same time

    - by Nyaro
    DataTables warning (table id = 'example-advanced'): Cannot reinitialise DataTable while using treetable and datatable at the same time. Here is my code: <script src="jquery-1.7.2.min.js"></script> <script src='jquery.dataTables.min.js'></script> <script src="jquery.treetable.js"></script> <script> $("#example-advanced").treetable({ expandable: true }); </script> <script> $('#example-advanced').dataTable( { "bSort": false } ); </script> Actually I wanted to get rid of the sorting part of the datatable coz it was giving error in treetable display so i want the sorting part from the datatable out and keep other functions like search and pagination. Please help me out. Thanks in advance.

    Read the article

  • Fastest way to convert datatable to generic list

    - by Joel Coehoorn
    I have a data tier select method that returns a datatable. It's called from a business tier method that should then return a strongly typed generic List. What I want to do is very similar (but not the same as) this question: http://stackoverflow.com/questions/208532/how-do-you-convert-a-datatable-into-a-generic-list What's different is that I want the list to contain strongly-typed objects rather than datarows (also, I don't have linq avaiable here yet). I'm concerned about performance. The business tier method will in turn be called from the presentation tier, and the results will be iterated for display to the user. It seems very wasteful to add an extra iteration at the business tier, only do it again right away for the presentation, so I want this to be as quick as possible. This is a common task, so I'm really looking for a good pattern that can be repeated over and over.

    Read the article

  • how to serialize a DataTable to json or xml

    - by loviji
    Hello, i'm trying to serialize DataTable to Json or XML. is it possibly and how? any tutorials and ideas, please. For example a have a sql table: CREATE TABLE [dbo].[dictTable]( [keyValue] [int] IDENTITY(1,1) NOT NULL, [valueValue] [int] NULL, CONSTRAINT [Psd2Id] PRIMARY KEY CLUSTERED ( [keyValue] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] C# code: string connectionString = "server=localhost;database=dbd;uid=**;pwd=**"; SqlConnection mySqlConnection = new SqlConnection(connectionString); string selectString = "SELECT keyValue, valueValue FROM dicTable"; SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = selectString; SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(); mySqlDataAdapter.SelectCommand = mySqlCommand; DataSet myDataSet = new DataSet(); mySqlConnection.Open(); string dataTableName = "dictionary"; mySqlDataAdapter.Fill(myDataSet, dataTableName); DataTable myDataTable = myDataSet.Tables[dataTableName]; //now how to serialize it?

    Read the article

  • How to bind DataTable to Chart series?

    - by user175908
    Hello, How to do bind data from DataTable to Chart series? I get null reference exception. I tried binding with square brackets and it did not worked either. So, how to do the binding? Thanks. P.S: I included DataGrid XAML and CS which works just fine. Converting data to List<KeyValuePair<string,int>> works good but it is kinda slow and is unnessesary trash in code. I use WPFToolkit (the latest version). XAML: <Window x:Class="BindingzTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="606" Width="988" xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"> <Grid Name="LayoutRoot"> <charting:Chart Title="Letters and Numbers" VerticalAlignment="Top" Height="400"> <charting:Chart.Series> <charting:ColumnSeries Name="myChartSeries" IndependentValueBinding="{Binding Letter}" DependentValueBinding="{Binding Number}" ItemsSource="{Binding}" /> </charting:Chart.Series> </charting:Chart> <DataGrid Name="myDataGrid" VerticalAlignment="Stretch" Margin="0,400,0,50" ItemsSource="{Binding}" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Letter" Binding="{Binding Letter}"/> <DataGridTextColumn Header="Number" Binding="{Binding Number}"/> </DataGrid.Columns> </DataGrid> <Button Content="Generate" HorizontalAlignment="Left" Name="generateButton" Width="128" Click="GenerateButtonClicked" Height="52" VerticalAlignment="Bottom" /> </Grid> CS: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } DataTable GenerateMyTable() { var myTable = new DataTable("MyTable"); myTable.Columns.Add("Letter"); myTable.Columns.Add("Number"); myTable.Rows.Add("A", 500); myTable.Rows.Add("B", 400); myTable.Rows.Add("C", 500); myTable.Rows.Add("D", 600); myTable.Rows.Add("E", 300); myTable.Rows.Add("F", 200); return myTable; } private void GenerateButtonClicked(object sender, RoutedEventArgs e) { var myGeneratedTable = GenerateMyTable(); myDataGrid.DataContext = myGeneratedTable; myChartSeries.DataContext = myGeneratedTable; // Calling this throws "Object reference not set to an instance of an object" exception } }

    Read the article

  • Problem with the DataTable and DataGridView objects

    - by Karol
    Hello everyone, I have the following problem In my aplication I doing some calculations and after it put them into DataTable object (6 columns, data in the latest one is most important). To view the results I put them into DataGridView object and there is my problem. Depending on the data contained in the last column I want to mark the cells on the appropriate colors. And I don't know if I should do this on the DataGridView object because this is user interfaces? Where I can do this? DataTable object doesn't have a style properties? Thanks a lot...

    Read the article

  • Filter DataTable to show only the most recent transaction for each user

    - by Dan Neely
    I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a RowFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value? sample data and results UserID UserTransactionID PassesFilter 1 1 False 1 2 False 1 3 True 2 1 True 3 1 False 3 2 True My data is orginating in a non-SQL source, the DataTable is being created to be bound to a DataGridView so I can't make changes to a query being used to get the data initially.

    Read the article

  • Populate DataTable with LINQ in C#

    - by RaYell
    I have a method in my app that populates DataTable with the data using the following code: DataTable dt = this.attachmentsDataSet.Tables["Attachments"]; foreach (Outlook.Attachment attachment in this.mailItem.Attachments) { DataRow dr = dt.NewRow(); dr["Index"] = attachment.Index; dr["DisplayName"] = String.Format( CultureInfo.InvariantCulture, "{0} ({1})", attachment.FileName, FormatSize(attachment.Size)); dr["Name"] = attachment.FileName; dr["Size"] = attachment.Size; dt.Rows.Add(dr); } I was wondering if I could achieve the same functionality using LINQ in order to shorten this code a bit. Any ideas?

    Read the article

  • DataView Vs DataTable.Select()

    - by Aseem Gautam
    Considering the code below: Dataview someView = new DataView(sometable) someView.RowFilter = someFilter; if(someView.count > 0) { …. } Quite a number of articles which say Datatable.Select() is better than using DataViews, but these are prior to VS2008. Solved: The Mystery of DataView's Poor Performance with Large Recordsets Array of DataRecord vs. DataView: A Dramatic Difference in Performance So in a situation where I just want a subset of datarows based on some filter criteria(single query) and what is better DataView or DataTable.Select()?

    Read the article

  • Get the corresponding row in the datatable from the selection in datagridview

    - by The King
    Hi All, I have a DataTable which is bound to datagridview (Winforms)... I use the following two lines to get the DataRow that is selected in the datagridview... int l_intSelectedRow = DataGridView1.SelectedRows[0].Index; DataRow l_drwSelectedRow = ControlGroupPostedItems.Tables["PostedItems"].Rows[l_intSelectedRow]; This works fine until the DataGridView is Sorted... When the gridview is sorted by the, I get the incorrect values (1st selection of the sorted view return 1st row of unsorted Table). How could I solve this... Is looping through the datatable the only way... Thank you.

    Read the article

  • How can I transform a DataTable in a group-by date DataTable with LINQ?

    - by alex
    I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ... col_n 1.3.2010 00:00 12.5 0 ... 100 1.3.2010 01:00 0 0 ... 100 1.3.2010 22:00 0 0 ... 100 1.3.2010 23:00 12.5 0 ... 100 ... 31.3.2010 00:00 2 0 ... 100 31.3.2010 01:00 2 0 ... 200 I need to sum up the rows grouped by dates to get a DataTable like that (dstTbl): date, col_1 col_2 ... col_n 1.3.2010 15 0 ... 400 ... 31.3.2010 4 0 ... 300 Is this possible by using LINQ and if then how?

    Read the article

  • Storing the records in csv file from datatable.

    - by Harikrishna
    I have datatable and I am displaying those values in the datagridview with the helping of code : dataGridView1.ColumnCount = TableWithOnlyFixedColumns.Columns.Count; dataGridView1.RowCount = TableWithOnlyFixedColumns.Rows.Count; for (int i = 0; i < dataGridView1.RowCount; i++) { for (int j = 0; j < dataGridView1.ColumnCount; j++) { dataGridView1[j, i].Value = TableWithOnlyFixedColumns.Rows[i][j].ToString(); } } TableExtractedFromFile.Clear(); TableWithOnlyFixedColumns.Clear(); Now I want to save the records in the datatable in csv file.How can I do that ?

    Read the article

  • DataTable from TextFile?

    - by Craig
    I have taken over an application written by another developer, which reads data from a database, and exports it. The developer used DataTables and DataAdaptors. So, _dataAdapter = new SqlDataAdapter("Select * From C....", myConnection); and then ExtractedData = new DataTable("CreditCards"); _dataAdapter.Fill(ExtractedData); ExtractedData is then passed around to do different functions. I have now been told that I need to, in addition to this, get the same format of data from some comma separated text files. The application does the same processing - it's just getting the data from two sources. So, I am wondering if I can get the data read into a DataTable, as above, and then ADD more records from a CSV file. Is this possible?

    Read the article

  • bind a WPF datagrid to a datatable

    - by Jim Thomas
    I have used the marvelous example posted at: http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx to bind a WPF datagrid to a datatable. The source code below compiles fine; it even runs and displays the contents of the InfoWork datatable in the wpf datagrid. Hooray! But the WPF page with the datagrid will not display in the designer. I get an incomprehensible error instead on my design page which is shown at the end of this posting. I assume the designer is having some difficulty instantiating the dataview for display in the grid. How can I fix that? XAML Code: xmlns:local="clr-namespace:InfoSeeker" <Window.Resources> <ObjectDataProvider x:Key="InfoWorkData" ObjectType="{x:Type local:InfoWorkData}" /> <ObjectDataProvider x:Key="InfoWork" ObjectInstance="{StaticResource InfoWorkData}" MethodName="GetInfoWork" /> </Window.Resources> <my:DataGrid DataContext="{Binding Source={StaticResource InfoWork}}" AutoGenerateColumns="True" ItemsSource="{Binding}" Name="dataGrid1" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" /> C# Code: namespace InfoSeeker { public class InfoWorkData { private InfoTableAdapters.InfoWorkTableAdapter infoAdapter; private Info infoDS; public InfoWorkData() { infoDS = new Info(); infoAdapter = new InfoTableAdapters.InfoWorkTableAdapter(); infoAdapter.Fill(infoDS.InfoWork); } public DataView GetInfoWork() { return infoDS.InfoWork.DefaultView; } } } Error shown in place of the designer page which has the grid on it: An unhandled exception has occurred: Type 'MS.Internal.Permissions.UserInitiatedNavigationPermission' in Assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) ...At:Ms.Internal.Designer.DesignerPane.LoadDesignerView()

    Read the article

  • C# - Fill a combo box with a DataTable

    - by MrG
    I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop: // Form has a menu containing a combobox added via SharpDevelop's GUI // --- Variables languages = new string[2]; languages[0] = "English"; languages[1] = "German"; DataSet myDataSet = new DataSet(); // --- Preparation DataTable lTable = new DataTable("Lang"); DataColumn lName = new DataColumn("Language", typeof(string)); lTable.Columns.Add( lName ); for( int i=0; i<languages.Length; i++ ) { DataRow lLang = lTable.NewRow(); lLang["Language"] = languages[i]; lTable.Rows.Add(lLang); } myDataSet.Tables.Add(lTable); // --- Handling the combobox mnuActionLanguage.ComboBox.DataSource = myDataSet.Tables["Lang"].DefaultView; mnuActionLanguage.ComboBox.DisplayMember = "Language"; One would assume to see some values in the dropdown, but it's empty. Please tell me what I'm doing wrong ;( EDIT: mnuActionLanguage.ComboBox.DataBind() is what I also found on the net, but it doesn't work in my case. SOLUTION mnuActionLanguage.ComboBox.BindingContext = this.BindingContext; at the end solved the problem!

    Read the article

  • Rich faces and dataTable

    - by ortho
    Hi all :) I have the question regarding rich faces and beans. I have a jsp page that is using richfaces and inside it I have the: rich:extendedDatatable component, that takes data from my MainBean as ArrayList (this bean queries the mySQL and puts results to the ArrayList that populates the dataTable later on). There are 4 columns in datatable, first 3 are h:outputLabels and the last one is checkbox. Now I have a question: how can I get information from selected row ? I mean, when user clicks checkbox, I want to take the id/name or whatever that is associated to this particular row, then when user clicks on Apply changed a4j: button I will update the database and when user logs in back again he will see updated info: e.g. checkbox is selected/not selected now because the user checked that. I believe that is a simple query for someone who worked with it. For me ex. flash developer it would be easy in as3, but here I didnt find the solution yet, please help. Thank you in advance, Kindest regards

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >