Search Results

Search found 1403 results on 57 pages for 'yui datatable'.

Page 7/57 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • DataTable ReadXmlSchema and ReadXml Resulting in error

    - by MasterMax1313
    I'm having some trouble with the ReadXmlSchema and ReadXml methods for a DataTable. I'm getting the error "DataTable does not support schema inference from Xml". Code Snippet: I've tried Table.ReadXmlSchema(new StringReader(File.ReadAllText(XsdFilePath))); Table.ReadXml(new StringReader(File.ReadAllText(XmlFilePath))); And Table.ReadXmlSchema(XsdFilePath); Table.ReadXml(XmlFilePath); Xml Snippet: <ScreenSets> <ScreenSet id="Credit 1"> <Screen xmlFile="sb-credit1.en.xml" tabText="Recommendation" isCached="false"> <Buttons> <Button id="btnClosePresentation"/> </Buttons> </Screen> </ScreenSet> <ScreenSet id="Credit 2"> <Screen xmlFile="sb-credit2.en.xml" tabText="Recommendation" isCached="false"> <Buttons> <Button id="btnClosePresentation"/> </Buttons> </Screen> </ScreenSet> <ScreenSet id="Credit 3"> <Screen xmlFile="sb-credit3.en.xml" tabText="Recommendation" isCached="false"> <Buttons> <Button id="btnClosePresentation"/> </Buttons> </Screen> </ScreenSet> </ScreenSets> Xsd: <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="ScreenSets"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="ScreenSet"> <xs:complexType> <xs:sequence> <xs:element name="Screen"> <xs:complexType> <xs:sequence> <xs:element name="Buttons"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Button"> <xs:complexType> <xs:attribute name="id" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="xmlFile" type="xs:string" use="required" /> <xs:attribute name="tabText" type="xs:string" use="required" /> <xs:attribute name="isCached" type="xs:boolean" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="id" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

    Read the article

  • DataTable to JSON

    - by Joel Coehoorn
    I recently needed to serialize a datatable to JSON. Where I'm at we're still on .Net 2.0, so I can't use the JSON serializer in .Net 3.5. I figured this must have been done before, so I went looking online and found a number of different options. Some of them depend on an additional library, which I would have a hard time pushing through here. Others require first converting to List<Dictionary<>>, which seemed a little awkward and needless. Another treated all values like a string. For one reason or another I couldn't really get behind any of them, so I decided to roll my own, which is posted below. As you can see from reading the //TODO comments, it's incomplete in a few places. This code is already in production here, so it does "work" in the basic sense. The places where it's incomplete are places where we know our production data won't currently hit it (no timespans or byte arrays in the db). The reason I'm posting here is that I feel like this can be a little better, and I'd like help finishing and improving this code. Any input welcome. public static class JSONHelper { public static string FromDataTable(DataTable dt) { string rowDelimiter = ""; StringBuilder result = new StringBuilder("["); foreach (DataRow row in dt.Rows) { result.Append(rowDelimiter); result.Append(FromDataRow(row)); rowDelimiter = ","; } result.Append("]"); return result.ToString(); } public static string FromDataRow(DataRow row) { DataColumnCollection cols = row.Table.Columns; string colDelimiter = ""; StringBuilder result = new StringBuilder("{"); for (int i = 0; i < cols.Count; i++) { // use index rather than foreach, so we can use the index for both the row and cols collection result.Append(colDelimiter).Append("\"") .Append(cols[i].ColumnName).Append("\":") .Append(JSONValueFromDataRowObject(row[i], cols[i].DataType)); colDelimiter = ","; } result.Append("}"); return result.ToString(); } // possible types: // http://msdn.microsoft.com/en-us/library/system.data.datacolumn.datatype(VS.80).aspx private static Type[] numeric = new Type[] {typeof(byte), typeof(decimal), typeof(double), typeof(Int16), typeof(Int32), typeof(SByte), typeof(Single), typeof(UInt16), typeof(UInt32), typeof(UInt64)}; // I don't want to rebuild this value for every date cell in the table private static long EpochTicks = new DateTime(1970, 1, 1).Ticks; private static string JSONValueFromDataRowObject(object value, Type DataType) { // null if (value == DBNull.Value) return "null"; // numeric if (Array.IndexOf(numeric, DataType) > -1) return value.ToString(); // TODO: eventually want to use a stricter format // boolean if (DataType == typeof(bool)) return ((bool)value) ? "true" : "false"; // date -- see http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx if (DataType == typeof(DateTime)) return "\"\\/Date(" + new TimeSpan(((DateTime)value).ToUniversalTime().Ticks - EpochTicks).TotalMilliseconds.ToString() + ")\\/\""; // TODO: add Timespan support // TODO: add Byte[] support //TODO: this would be _much_ faster with a state machine // string/char return "\"" + value.ToString().Replace(@"\", @"\\").Replace(Environment.NewLine, @"\n").Replace("\"", @"\""") + "\""; } }

    Read the article

  • Exception thrown in YUI: "Sizzle" is not defined!

    - by nanobyt3
    Hi, We are using HTML Unit v2.6 with Web-Harvest and extended its functionality to create a new element <web session="sess1" browser="firefox2"> <web-getpage url="https://www.linkedin.com/secure/login"/> <web-setinput name="uname">username</web-setinput> <web-setinput name="pwd">password</web-setinput> <web-clickinput name="login"/> </web> When we run this we get an exception while the element loads the URL specified. The details are as below: Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function hasOwnProperty in object net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "Sizzle" is not defined. at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3651) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3657) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3676) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3740) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1501) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:427) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:263) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3058) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:415) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520) ... 42 more As it appears that 'Sizzle' (present in YUI3) is causing this. We then checked the same in Firefox and IE but neither of the browsers showed any error of 'Sizzle' not being defined. Also we tried to use latest snapshot of htmlunit, but had same issue. Is this a limitation(bug) of HTML Unit JavaScript engine? OR Is there anyway to configure HTML Unit to handle this exception? If anyone has already had such an issue, please do let us know. Any help is very much appreciated. Thanks in advance !

    Read the article

  • How to "chain" modal dialogs in YUI 2 ?

    - by giulio
    I have a modal dialog box presented in Yahoo UI. The user selects a value from dialog "A", and then I want to present another modal dialog box to collect some more data in dialog "B". I have been using the YAHOO.widget.Dialog successfully. The problem seems to be that you can't initiate dialog window "B" from the handler function of dialog "A". So, how can you programmatically launch a second dialog window after the user hits the "OK" button on the first ? (I had tried to create an additional Listener for a field that is updated in dialog "A" to trigger dialog "B" but this doesn't work either.) Thanks..

    Read the article

  • Accessing YUI RichTextEditor node

    - by Doesntmatter
    I'm inserting images to editor with id param. after that i'm trying to access it with Dom.get('id'), but it returns null. I understand that it returns null because it works under parent window's scope. Is there any standard way to access it?

    Read the article

  • YUI 3 Selector for multiple class names

    - by Jasie
    Hello, I have a bunch of divs like this: <div class="bear"></div> <div class="dog"></div> How do I get a nodelist that includes all divs with class of bear and dog? I tried: Y.get(".bear .dog").each(function() { }); But it returns null. Anyone have any suggestions? Thanks!

    Read the article

  • How to disable a YUI MenuBarItem from markup

    - by Bears will eat you
    I prefer creating my nav menus from markup (rather than Javascript), like in this example. Is it possible to create menus and/or menu items from markup which are disabled? I see how to use Javascript to do this (use the disabled config property), but I'm looking for some way to encode this information in markup - perhaps there's a CSS class to use? Or am I out of luck here?

    Read the article

  • jQuery Datatable dynamic edit button attached to each row

    - by will
    totally new to jquery and datatable. I would like to add an edit button that call forth a colorbox div that displays all the editable field. can anyone point me in the right direction on how this can be achieved? I was able to add a sClass to each field and use fnDrawCallback callback to call colorbox from field. But this is kind of messy and I rather just have a button at the end of each row for edit purpose. thanks very much for any pointers.

    Read the article

  • JQuery Datatable Question: Centering column data after data insertion

    - by Chris
    I have a data table that is initially empty and is populated after a particular Javascript call. After the data is inserted into the table, I'd like to center all of the data in one of the columns. I tried specifying this at the initialization step in this way: dTable = $('#dt').datatable({ 'aoColumns': [ null, null, { "sClass" : "center" }] }); The data in the third column was not centered after the insertions were complete. I tried modifying aoColumns after the insertions and redrawing the table as well: dTable.fnSettings().aoColumns[2].sClass = "center"; dTable.fnDraw(); This did not work either. So my question is simply how should I go about telling the data table to center the data in the third column? Thanks in advance for your suggestions. Chris

    Read the article

  • Datatable and Datagridview.

    - by Harikrishna
    I have datatable table like id name address phoneno 1 abc kfjskl 798798 2 bcd kjdsfl 808909 3 899009 fjsh kjllkjl 5 jfkd And I am displaying this value in the datagridview by code dataGridView1.ColumnCount = Table.Columns.Count; dataGridView1.RowCount = Table.Rows.Count; for (int i = 0; i < dataGridView1.RowCount; i++) { for (int j = 0; j < dataGridView1.ColumnCount; j++) { dataGridView1[j, i].Value = Table.Rows[i][j].ToString(); } } Now I don't want to display row that has some missing value like If I will do that then the datagridview will look like 1 abc kfjskl 798798 2 bcd kjdsfl 808909 How can I do that ?

    Read the article

  • Js/Jquery bind Datatable or Datalist

    - by Robin Rieger
    Scenario I have a input box for post codes. When you put in a postcode it makes a call to a web service and gets all the suburb names back and binds them to a list, like an input dropdown list. This works when I return a List<string> from the web service for just the names. No problem. The problem arises when I go to save the values to the db. When it gets saved I cannot save the name of the suburb in the suburb column in the db. I have to save the id of that suburb for the foreign key constraint. So then I changed the List<> thing slighty and cheated and returned the following. <ArrayOfString> <string>8213</string> <string>BROOKFIELD</string> <string>8214</string> <string>CHAPEL HILL</string> <string>8215</string> <string>FIG TREE POCKET</string> etc.... The reason for this is so I can have the value of the item in the drop down as the id and hence can save that in the code behind on save. To do this, I did the following: $(result).each(function (index, value) { var suburbname; var pattern = new RegExp('[0-9*]'); var m = pattern.exec(value); if (m == null) { suburbname = value var o = new Option(suburbname, suburbid); /// jquerify the DOM object 'o' so we can use the html method $(o).html(suburbname); $(document.getElementById('<%= suburb.ClientID %>')).append($("<option></option>") .attr("value", suburbid) .text(suburbname)); } else { suburbid = value } That works as well... the drop down only has name and the value for those is the number The problem....? I am making assumptions above which I don't like... I.e. that the name never has a number it, that the web service will always return the id first to set the id before running the add to the dropdown for the first time. It just feels wrong.... :S (thoughts?) So, if I change the web service to return a datatable, to out the following (which is what the whole query returns): <Suburbs diffgr:id="Suburbs1" msdata:rowOrder="0"> <SuburbID>8213</SuburbID> <SuburbName>BROOKFIELD</SuburbName> <StateID>4</StateID> <StateCode>07</StateCode> <CountryCode>61</CountryCode> <TimeZones>10.00</TimeZones> <Postcode>4069</Postcode> </Suburbs> Is there a way of acheiving the same as above in js/jquery. So when the user inputs the postcode the webservice returns the datatable and then binds it to the select with the SuburbID going into the value and the name going into the text??? Any other ways I could return the data from the web service to solve this? Note: essentially I need the option to look like this: <option value="8213">BROOKFIELD</option> I also thought I could make a second call to get just the id on the bind of the text... but I kind of want to only make one call.... Thanks in adance, Cheers Robin .net, C#, js, jquery, web service..... Solution with guidance from Billy The adding to the select using the other method below did not work, but my original way did once I had the correct variables so just used that.... The service returns: <ArrayOfMyClass> <MyClass> <ID>8213</ID> <Name>BROOKFIELD</Name> </MyClass> ... etc The js is: (note: it is onchange of the postcode input box. it runs a web service and then on success runs the following) function OnCompleted(result) { var _suburbs = result; var i = 0; $(_suburbs).each(function () { var SuburbName = _suburbs[i].Name; var SuburbID = _suburbs[i].ID; $(document.getElementById('<%= suburb.ClientID %>')).append($("<option></option>") .attr("value", SuburbID) .text(SuburbName)); i = i + 1; });

    Read the article

  • How to get DataTable to serialize better?

    - by AngryHacker
    I have the following code that serializes a DataTable to XML. StringWriter sw = new StringWriter(); myDataTable.WriteXml(sw); And this works, however, the serialized XML looks like this: <NameOfTable> <NameOfTable> <ID>1</ID> <Name>Jack</Name> </NameOfTable> <NameOfTable> <ID>2</ID> <Name>Frank</Name> </NameOfTable> </NameOfTable> Is there anyway to change the outer <NameOfTable> to, say, <Records> and the inner <NameOfTable> to <Person>?

    Read the article

  • Querying datatable to get rows with a certain value in the first column

    - by user1776590
    I am currently using the code below and am wondering if it would be possible to query based on an entry value. At the moment it returns the number of rows that have been defined. var q = sqlData.AsEnumerable().Take(2); This data comes in from a database and is imputed into the table but at the moment it only returns database data into the datatable and allows me to select the first two rows and I was wondering if I can query the data table so that I can get the rows that I require based on an index in the actual table itself (e.g. in the table I find five rows and query this information out).

    Read the article

  • Validation for selected row in JSF h:datatable

    - by Barun
    Hi all, I am having a tough time trying to find a solution to the following design related to h:dataTable. I have certain number of rows predisplayed. The first column is only checkboxes. The rest of the columns are disabled by default. On selecting a checkbox the elements in the corresponding rows get enabled. On submit of the for the values in the enabled row have to be validated on the server side. I am able to validate for invalid inputs but am not finding a method to use required="true" conditionally. Or any other method. Could anyone please help me on this. Thanks Barun

    Read the article

  • JSF commandbutton id inside datatable

    - by user236501
    How can I add in commandbutton inside datatable? <hx:dataTableEx value="#{searchData.searchFriends}" var="s"> <hx:columnEx> <f:facet name="header"> <h:outputText value="First Name" /> </f:facet> <hx:requestLink action="#{pc_Search.doAddFriendAction}"> <h:outputText value="Add as Friend" /> <f:param name="friendId" value="#{s.memberId}" /> </hx:requestLink> </hx:columnEx> </hx:dataTableEx> To get the data at backend String friendId = (String)getRequestParam().get("friendId"); But once I change the requestlink to command button the friedId = null? any idea how can i pass value using command button

    Read the article

  • How to insert many rows of data from arrays/lists to SQL Server (DataSet, DataTable)

    - by Kamil
    I need little help with transferring data from variables, arrays, lists to my SQL Server. Im not bad in SQL, but im not familiar with DataSet, DataTable objects. My data is now stored in list of strings (List). Every string in that list looks similar to this: QWERTY,19920604,0.91,0.35,0.34,0.35,343840 There are about 900000 rows like this. Target datatypes in SQL Server: BIGINT (primary key, im not inserting it, its identity(1,1)) VARCHAR(10), DATE, DECIMAL(10,2), DECIMAL(10,2), DECIMAL(10,2), DECIMAL(10,2), INT How to convert that data to SQL Server data types? How to insert that data into SQL Server? Also i need some progress bar updates between inserts. I could do this using old-fashion SQL command, but i have learn more modern way :)

    Read the article

  • C# WPF XAML DataTable binding to relation

    - by LnDCobra
    I have 2 tables: COmpany {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 Any ideas? Edit: I still can't get this to work, What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • C# WPF XAML DataTable binding to relationship

    - by LnDCobra
    I have the following tables: Company {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • C# WPF XAML binding to DataTable

    - by LnDCobra
    I have the following tables: Company {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • Accessing deleted rows from a DataTable

    - by Ken
    Hello: I have a parent WinForm that has a MyDataTable _dt as a member. The MyDataTable type was created in the "typed dataset" designer tool in Visual Studio 2005 (MyDataTable inherits from DataTable) _dt gets populated from a db via ADO.NET. Based on changes from user interaction in the form, I delete a row from the table like so: _dt.FindBySomeKey(_someKey).Delete(); Later on, _dt is passed by value to a dialog form. From there, I need to scan through all the rows to build a string: foreach (myDataTableRow row in _dt) { sbFilter.Append("'" + row.info + "',"); } The problem is that upon doing this after a delete, the following exception is thrown: DeletedRowInaccessibleException: Deleted row information cannot be accessed through the row. The work around that I am currently using (which feels like a hack) is the following: foreach (myDataTableRow row in _dt) { if (row.RowState != DataRowState.Deleted && row.RowState != DataRowState.Detached) { sbFilter.Append("'" + row.info + "',"); } } My question: Is this the proper way to do this? Why would the foreach loop access rows that have been tagged via the Delete() method??

    Read the article

  • Loading google datatable using ajax/json

    - by puff
    I can't figure out how to load a datable using ajax/json. Here is my json code in a remote file (pie.json) { cols: [{id: 'task', label: 'Task', type: 'string'}, {id: 'hours', label: 'Hours per Day', type: 'number'}], rows: [{c:[{v: 'Work'}, {v: 11}]}, {c:[{v: 'Eat'}, {v: 2}]}, {c:[{v: 'Commute'}, {v: 2}]}, {c:[{v: 'Watch TV'}, {v:2}]}, {c:[{v: 'Sleep'}, {v:7, f:'7.000'}]} ] } This is what I have tried so far but it doesn't work. <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["piechart"]}); function ajaxjson() { jsonreq=GetXmlHttpObject(); jsonreq.open("GET", "pie.json", true); jsonreq.onreadystatechange = jsonHandler; jsonreq.send(null); } function jsonHandler() { if (jsonreq.readyState == 4) { var res = jsonreq.responseText; google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(res, 0.6) var chart = new google.visualization.PieChart(document.getElementByI('chart_div')); chart.draw(data, {width: 400, height: 240, is3D: true}); } // end drawChart } // end if } // end jsonHandler function GetXmlHttpObject() { var xmlHttp=null; xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); return xmlHttp; } Things work perfectly if I replace the 'res' variable with the actual code in pie.json. Any help would be greatly appreciated.

    Read the article

  • SQL ORACLE - Datatable in where clause

    - by Gage
    Currently I have a sql call returning a dataset from a MSSQL database and I want to take a column from that data and return ID's based off that column from the ORACLE database. I can do this one at a time but that requires multiple calls, I am wondering if this can be done with one call. String sql=String.Format(@"Select DIST_NO FROM DISTRICT WHERE DIST_DESC = '{0}'", row.Table.Rows[0]["Op_Centre"].ToString()); Above is the string I am using to return one ID at a time. I know the {0} can be used to format your value into the string and maybe there is a way to do that with a datatable. Also to use multiple values in the where clause it would be: String sql=String.Format(@"Select DIST_NO FROM DISTRICT WHERE DIST_DESC in ('{0}')", row.Table.Rows[0] ["Op_Centre"].ToString()); Although I realize all of this can be done I am wondering if theres an easy way to add it all to the sql string in one call. As I am writing this I am realizing I could break the string into sections then just add every row value to the SQL string within the "WHERE DIST_DESC IN (" clause... I am still curious to see if there is another way though, and because someone else may come across this problem I will post a solution if I develop one. Thanks in advance.

    Read the article

  • Synchronizing DataGridView (DataTable) with the DB

    - by Ezekiel Rage
    Hi! I have the following situation: there is a table in the DB that is queried when the form loads and the retrieved data is filled into a DataGridView via the DataTable underneath. After the data is loaded the user is free to modify the data (add / delete rows, modify entries). The form has 2 buttons: Apply and Refresh. The first one sends the changes to the database, the second one re-reads the data from the DB and erases any changes that have been made by the user. My question is: is this the best way to keep a DataGridView synchronized with the DB (from a users point of view)? For now these are the downsides: the user must keep track of what he is doing and must press the button every while the modifications are lost if the form is closed / app crash / ... I tried sending the changes to the DB on CellEndEdit event but then the user also needs some Undo/Redo functionality and that is ... well ... a different story. So, any suggestions?

    Read the article

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