Daily Archives

Articles indexed Sunday May 23 2010

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

  • In-Memory SQL-CE

    - by harley.333
    Is there a way to connect to a SQL-CE database as a stream? Specifically, our ASP.Net application builds small SDF at runtime for off-line needs. When the user is done with his off-line duties, he uploads the SDF and the application imports the new and updated data. No problems there. Currently, we're saving the uploaded SDF to the web-server's hard-drive and connecting to the file. Can we connect to the uploaded SDF without saving it to the hard-drive? We are using the DbProviderFactory.CreateConnection method, but we're open to suggestions.

    Read the article

  • GNU Make - Dependencies on non program code

    - by Tim Post
    A requirement for a program I am writing is that it must be able to trust a configuration file. To accomplish this, I am using several kinds of hashing algorithms to generate a hash of the file at compile time, this produces a header with the hashes as constants. Dependencies for this are pretty straight forward, my program depends on config_hash.h, which has a target that produces it. The makefile looks something like this : config_hash.h: $(SH) genhash config/config_file.cfg > $(srcdir)/config_hash.h $(PROGRAM): config_hash.h $(PROGRAM_DEPS) $(CC) ... ... ... I'm using the -M option to gcc, which is great for dealing with dependencies. If my header changes, my program is rebuilt. My problem is, I need to be able to tell if the config file has changed, so that config_hash.h is re-generated. I'm not quite sure how explain that kind of dependency to GNU make. I've tried listing config/config_file.cfg as a dependency for config_hash.h, and providing a .PHONY target for config_file.cfg without success. Obviously, I can't rely on the -M switch to gcc to help me here, since the config file is not a part of any object code. Any suggestions? Unfortunately, I can't post much of the Makefile, or I would have just posted the whole thing.

    Read the article

  • Multiple Connection Types for one Designer Generated TableAdapter

    - by Tim
    I have a Windows Forms application with a DataSet (.xsd) that is currently set to connect to a Sql Ce database. Compact Edition is being used so the users can use this application in the field without an internet connection, and then sync their data at day's end. I have been given a new project to create a supplemental web interface for displaying some of the same reports as the Windows Forms application so certain users can obtain reports without installing the Windows app. What I've done so far is create a new Web Project and added it to my current Solution. I have split both the reports (.rdlc) and DataSets out of the Windows Forms project into their own projects so they can be accessed by both the Windows and Web applications. So far, this is working fine. Here's my dilemma: As I said before, the DataSets are currently set up to connect to a local Sql Ce database file. This is correct for the Windows app, but for the Web application I would like to use these same TableAdapters and queries to connect to the Sql Server 2005 database. I have found that the designer generated, strongly-typed TableAdapter classes have a ConnectionModifier property that allows you to make the TableAdapter's Connection public. This exposes the Connection property and allows me to set it, however it is strongly-typed as a SqlCeConnection, whereas I would like to set it to a SqlConnection for my Web project. I'm assuming the DataSet Designer strongly-types the Connection, Command, and DataAdapter objects based on the Provider of the ConnectionString as indicated in the app.config file. Is there any way I can use some generic provider so that the DataSet Designer will use object types that can connect to both a Sql Ce database file AND the actual Sql Server 2005 database? I know that SqlCeConnection and SqlConnection both inherit from DbConnection, which implements IDbConnection. Relatively, the same goes for SqlCeCommand/SqlCommand:DbCommand:IDbCommand. It would be nice if I could just figure out a way for the designer to use the Interface types rather than the strong types, but I'm hesitant that that is possible. I hope my problem and question are clear. Any help is much appreciated. Let me know if there's anything I can clarify.

    Read the article

  • Using Subsonic 2.2 on Windows Mobile 5 with SQL Server CE 3.5

    - by Darren
    I have seen comments stating that Subsonic currently does nt support MS SQL Server CE (http://stackoverflow.com/questions/1130863/subsonic-and-ms-sql-server-compact-data-provider). The link provided is for Subsonic 3. So my question is, does Subsonic 2.2 support MS SQL Server CE? And if so, is there any documentation on how to use sonic.exe to generate Subsonic's classes and controllers from the database file?

    Read the article

  • Solution Items in Visual Studio 2005/2008

    - by Muneeb
    Is it possible to add a class as a solution item and use it as a linked item in all the projects in the solution? Basically I was thinking of creating a class (which will inherit ConfigurationSection) and keeping it as the Solution Item. I wanted to add it as a linked item in all the projects in the solution, so that everyone can use it to access the configuration properties. (Refer to this tutorial for more details) Now the issue I am facing is that when I create a class in the solution item, it doesn't have any namespace. And it shows up in intellisense, inside the projects but once I create an object of the solution item class, the object doesn't show up in intellisense. Any ideas why?

    Read the article

  • JQuery Tooltip Plugin from Jorn

    - by Jeff Ancel
    I am thinking someone may have run across this one, but not sure. From a high level, I am trying to roll over a input [type=text] and display a tool tip (with the contained value) using the plugin available at http://bassitance.de. I have to use titles and classes for validation on the specific elements, so I put a blank div to hold the input [type=text] value for the roll over. Issue: It won't hold the value of 2 text boxes at once. Once I put a value in the box on the right, the tooltip on the left goes away. Same thing if I switch it aroun. I can't keep a tooltip on more than one element. Here is the code (Note: You will have to download the plugins in the source as I am not sure where the live versions are if there are any). <link rel="stylesheet" href="/scripts/jquery-tooltip/jquery.tooltip.css" /> <script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/scripts/jquery-tooltip/jquery.tooltip.min.js"></script> <script type="text/javascript"> $(function(){ $("input").change(function(){ var newTitle = $(this).val(); $(this).parent().attr("title",newTitle); // re-init tool tip reload(); }); // Init tooltip reload(); }); reload = function(){ $("div").tooltip(); } </script> <body> <table border="1px solid black"> <tr> <td title="hello"> <div> <input type="text" value=""/> </div> </td> <td> <div> <input type="text" value=""/> </div> </td> </tr> </table> <div id="debug"></div> </body> </html>

    Read the article

  • Query returns too few rows

    - by Tareq
    setup: mysql> create table product_stock( product_id integer, qty integer, branch_id integer); Query OK, 0 rows affected (0.17 sec) mysql> create table product( product_id integer, product_name varchar(255)); Query OK, 0 rows affected (0.11 sec) mysql> insert into product(product_id, product_name) values(1, 'Apsana White DX Pencil'); Query OK, 1 row affected (0.05 sec) mysql> insert into product(product_id, product_name) values(2, 'Diamond Glass Marking Pencil'); Query OK, 1 row affected (0.03 sec) mysql> insert into product(product_id, product_name) values(3, 'Apsana Black Pencil'); Query OK, 1 row affected (0.03 sec) mysql> insert into product_stock(product_id, qty, branch_id) values(1, 100, 1); Query OK, 1 row affected (0.03 sec) mysql> insert into product_stock(product_id, qty, branch_id) values(1, 50, 2); Query OK, 1 row affected (0.03 sec) mysql> insert into product_stock(product_id, qty, branch_id) values(2, 80, 1); Query OK, 1 row affected (0.03 sec) my query: mysql> SELECT IFNULL(SUM(s.qty),0) AS stock, product_name FROM product_stock s RIGHT JOIN product p ON s.product_id=p.product_id WHERE branch_id=1 GROUP BY product_name ORDER BY product_name; returns: +-------+-------------------------------+ | stock | product_name | +-------+-------------------------------+ | 100 | Apsana White DX Pencil | | 80 | Diamond Glass Marking Pencil | +-------+-------------------------------+ 1 row in set (0.00 sec) But I want to have the following result: +-------+------------------------------+ | stock | product_name | +-------+------------------------------+ | 0 | Apsana Black Pencil | | 100 | Apsana White DX Pencil | | 80 | Diamond Glass Marking Pencil | +-------+------------------------------+ To get this result what mysql query should I run?

    Read the article

  • Re-ordering Remote Desktop Connections

    - by Brian Travis
    I have the adminpak.msi installed so that I can use the Remote Desktop MMC to connect to all of my servers. As I add a server, it goes to the bottom of the list of available servers. I can't find out how to re-order them into more logical groupings, or at least alphabetical. Any ideas?

    Read the article

  • File Storage for Web Applications: Filesystem vs DB vs NoSQL engines

    - by El Yobo
    I have a web application that stores a lot of user generated files. Currently these are all stored on the server filesystem, which has several downsides for me. When we move "folders" (as defined by our application) we also have to move the files on disk (although this is more due to strange design decisions on the part of the original developers than a requirement of storing things on the filesystem). It's hard to write tests for file system actions; I have a mock filesystem class that logs actions like move, delete etc, without performing them, which more or less does the job, but I don't have 100% confidence in the tests. I will be adding some other jobs which need to access the files from other service to perform additional tasks (e.g. indexing in Solr, generating thumbnails, movie format conversion), so I need to get at the files remotely. Doing this over network shares seems dodgy... Dealing with permissions on the filesystem as sometimes given us problems in the past, although now that we've moved to a pure Linux environment this should be less of an issue. What are the downsides of storing files as BLOBs in MySQL? I guess that it would massively increase the database size and reduce the effectiveness of caches, but are there other problems? Do the same problems exist with NoSQL systems like Cassandra? Does anyone have any other suggestions that might be appropriate?

    Read the article

  • Backup and Restore a SQLCE .sdf database

    - by Ruben Trancoso
    My application needs to backup and restore .sdf files. There is a single dataSet the the whole application and some bindngSource and table adapters on forms using this same dataset. Just for a sake of test I tryied to copy the .sdf in runtime for a backup folder and back to restore it and I got my application not finding the file like it was not there anymore. How should I manage connections to open and close the database since the dataSet do it automaticaly at begin and end of my application?

    Read the article

  • Select newly added Row - DataGridView and BindingSource

    - by Ruben Trancoso
    I'm adding a new Row to a BindingSource that is Bound to a DataGridView source.AddNew(); After this, use BindingSource to get the newly added row is return the next row in the DataGridView when its sorted. ROW "A" ROW "B" <- myBindingSource.AddNew(); ROW "C" myBindingSource.Current gives ROW "C". (it became the selected row in the DataGridView) I need this because I want to update just the newly added row DataRowView drv = (DataRowView)myBindingSource.Current; myTableAdapter.Update(drv.Row); and not the entire table. myTableAdapter.Update(myDataSet.myTable); and also, I would like to have this newly added line selected in the DataGridView after insertion. is it possible in some way?

    Read the article

  • Insert a Row with a sorted DataGridView

    - by Ruben Trancoso
    My DataGridView is bound to the same BindingSource as the Insert Form, and the Name column is sorted. After insert is done, the groupBindingSource.Current is not returning the new inserted DataRowView but the last row in the sort order what makes the Update do nothing. FormGroup formGroup = new FormGroup(); formGroup .Source = groupBindingSource; formGroup .setMode(FormGroup.Mode.Insert); if (formGroup .ShowDialog() == DialogResult.OK) { DataRowView drv = (DataRowView)groupBindingSource.Current; grupoTableAdapter.Update(drv.Row); }

    Read the article

  • Dynamic access of classes of a given namespace

    - by user322383
    Hi! I'm writing an interface that will be implemented by a lot of classes, and I'm writing a class that will hold a collection of instances of these implementations. Every class will have a default constructor. So, is there a simple way (e.g. using some kind of reflection) to put an instance of each of these implementing classes to the collection? Besides doing it manually, which is simple, yes, but a lot of work and error prone (what if I missed an implementation while writing the method? What if a new implementation came and I forgot to update the given method?). So, what I would like is to be able to iterate through all classes of a given namespace or maybe through the list of all available classes. My method then would simply check, through reflection, if the given class implements the given interface, and if it does, puts it into the collection. Thank you.

    Read the article

  • Delete a Row from a DataGridView given its index

    - by Ruben Trancoso
    My DataGridView is a single line selection and theres a rowEnter Event where I get the line index every time the selected line changes. private void rowEnter(object sender, DataGridViewCellEventArgs e) { currentRowIndex = e.RowIndex; } when I press a delete button I use the same index to delete the row myDataSet.Avaliado.Rows[currentRowIndex].Delete(); avaliadoTableAdapter.Update(myDataSet.Avaliado); it works fine if no column in the DataGridView is sorted, otherwise a get an error. What should be the way to know the row index in the dataset that corresponds to the rowindex from the DataGridView?

    Read the article

  • How do i compare 2 strings in shell?

    - by Thomas
    I want the user to input something at the command line either -l or -e. so e.g. $./report.sh -e I want an if statement to split up whatever decision they make so i have tried... if [$1=="-e"]; echo "-e"; else; echo "-l"; fi obviously doesn't work though Thanks

    Read the article

  • Format date from SQLCE to display in DataGridView

    - by Ruben Trancoso
    hi folks, I have a DataGridView bound to a table from a .sdf database through a BindSource. The date column display dates like "d/M/yyyy HH:mm:ss". e.: "27/2/1971 00:00:00". I want to make it display just "27/02/1971" in its place. I tried to apply DataGridViewCellStyle {format=dd/MM/yyyy} but nothing happens, event with other pre-built formats. On the the other side, there's a Form with a MasketTextBox with a "dd/MM/yyyy" mask to its input that is bound to the same column and uses a Parse and a Format event handler before display and send it to the db. Binding dataNascimentoBinding = new Binding("Text", this.source, "Nascimento", true); dataNascimentoBinding.Format += new ConvertEventHandler(Util.formatDateConvertEventHandler); dataNascimentoBinding.Parse += new ConvertEventHandler(Util.parseDateConvertEventHandler); this.dataNascimentoTxt.DataBindings.Add(dataNascimentoBinding); public static string convertDateString2DateString(string dateString, string inputFormat, string outputFormat ) { DateTime date = DateTime.ParseExact(dateString, inputFormat, DateTimeFormatInfo.InvariantInfo); return String.Format("{0:" + outputFormat + "}", date); } public static void formatDateConvertEventHandler(object sender, ConvertEventArgs e) { if (e.DesiredType != typeof(string)) return; if (e.Value.GetType() != typeof(string)) return; String dateString = (string)e.Value; e.Value = convertDateString2DateString(dateString, "d/M/yyyy HH:mm:ss", "dd/MM/yyyy"); } public static void parseDateConvertEventHandler(object sender, ConvertEventArgs e) { if (e.DesiredType != typeof(string)) return; if (e.Value.GetType() != typeof(string)) return; string value = (string)e.Value; try { e.Value = DateTime.ParseExact(value, "dd/MM/yyyy", DateTimeFormatInfo.InvariantInfo); } catch { return; } } Like you can see by the code it was expexted that Date coming from SQL would be a DateTime value as is its column, but my eventHandler is receiving a string instead. Likewise, the result date for parse should be a datetime but its a string also. I'm puzzled dealing with this datetime column.

    Read the article

  • Sync a WinForm with DatagridView

    - by Ruben Trancoso
    I have a Form with a DataGridView which DataSource is a BindingSource to a table. This view will have a single row selection and a button to delete, edit the current selected row in a popup Form and a insert button that will use the same Form as well. My question is how can I sync the pop Form with the current row? I tryied to use the RowStateChanged event to get and store the current selected Row to be used in the Form but I coudnt. After the event I get the row that was selected before. Other thing I dont understand yet in C# how to have a single recordSet and know wich is the current record even if its a new being inserted in a way that once in the Form all data being entered will show up at the same time in the DataGridView.

    Read the article

  • SQL CE unspecified error

    - by Ruben Trancoso
    Hello, I did a project with MS SQL Server CE that when installed in the 'costumer' machine just raises an unspecified excpetion. Did some research and looks like I did everything mentioned. The dev env has sql compact 3.5 installed and sql tools for vs 2005. Using dotNet 3.5. But to make it run in de dev machine I need to add the sqlcese30, sqlceqp30, sqlceme and sqlcecompact30 dlls and its works fine. The setup project put dotNet 2.0 as dependecy and I also added the dlls but it raises the exception and I cannot see where or what it is. Its just a single 'unspecified error' message. please help :)

    Read the article

  • In native C++, how does one use a SqlCe .sdf database?

    - by Omer Sabic
    Is there a simple way, without .NET? I've found some libraries but none for SqlCe 3.5. There is http://sqlcehelper.codeplex.com/ but it's far from done, since a major feature like using a password is not yet implemented. I've looked at the source and it uses OLEdb to handle the database. The offical Microsoft Northwind example (that is shipped with SQL Compact 3.1, but not with 3.5) also doesn't work, I've tried setting it up with no success. Actually I don't have a sample working code. Was anyone able to set it up paired with a passworded .sdf? What are the alternatives? Thanks.

    Read the article

  • Very interesting problem in Compact Framework

    - by Alexander
    Hi, i have a performance problem while inserting data to sqlce.I'm reading string and making inserts to My tables.In LU_MAM table,i insert 1000 records withing 8 seconds.After Mam tables i make some inserts but my largest table is CR_MUS.When i want to insert record into CR_MUS,it takes too much time.CR_MUS has 2000 records and insert takes 35 seconds.What can be reason?I use same logic in my insert functions.Do u have any idea?I use VS 2008 sp1. Dim reader As StringReader reader = New StringReader(data) cn = New SqlCeConnection(General.ConnString) cn.Open() If myTransfer.ClearTables(cn, cmd) = True Then progress = 0 '------------------------------------------ cmd = New SqlServerCe.SqlCeCommand Dim rs As SqlCeResultSet cmd.Connection = cn cmd.CommandType = CommandType.TableDirect Dim rec As SqlCeUpdatableRecord ' name of table While reader.Peek > -1 If strerr_col = "" Then satir = reader.ReadLine() ayrac = Split(satir, "|") If ayrac(0).ToString() = "LC" Then prgsbar.Maximum = Convert.ToInt32(ayrac(1)) ElseIf ayrac(0).ToString = "PPAR" Then . If ayrac(2).ToString <> General.PMVer Then ShowWaitCursor(False) txtDurum.Text = "Wrong Version" Exit Sub End If If p_POCKET_PARAMETERS = True Then cmd.CommandText = "POCKET_PARAMETERS" txtDurum.Text = "POCKET_PARAMETERS" rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable) rec = rs.CreateRecord() p_POCKET_PARAMETERS = False End If strerr_col = myVERI_AL.POCKET_PARAMETERS_I(ayrac, cmd, rs, rec) prgsbar.Value += 1 ElseIf ayrac(0).ToString() = "MAM" Then If p_LU_MAM = True Then txtDurum.Text = "LU_MAM " cmd.CommandText = "LU_MAM" rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable) rec = rs.CreateRecord() p_LU_MAM = False End If strerr_col = myVERI_AL.LU_MAM_I(ayrac, cmd, rs, rec) prgsbar.Value += 1 ElseIf ayrac(0).ToString = "KMUS" Then If p_CR_MUS = True Then cmd.CommandText = "CR_MUS" txtDurum.Text = "CR_MUS" rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable) rec = rs.CreateRecord() p_TR_KAMPANYA_MALZEME = False End If strerr_col = myVERI_AL.CR_MUS_I(ayrac, cmd, rs, rec) prgsbar.Value += 1 end while Public Function CR_KAMPANYA_MUSTERI_I(ByVal f_Line() As String, ByRef myComm As SqlCeCommand, ByRef rs As SqlCeResultSet, ByRef rec As SqlCeUpdatableRecord) As String Try rec.SetValue(0, If(f_Line(1) = String.Empty, DirectCast(DBNull.Value, Object), f_Line(1))) rec.SetValue(1, If(f_Line(2) = String.Empty, DirectCast(DBNull.Value, Object), f_Line(2))) rec.SetValue(2, If(f_Line(3) = String.Empty, DirectCast(DBNull.Value, Object), f_Line(3))) rec.SetValue(3, If(f_Line(5) = String.Empty, DirectCast(DBNull.Value, Object), f_Line(5))) rec.SetValue(4, If(f_Line(6) = String.Empty, DirectCast(DBNull.Value, Object), f_Line(6))) rs.Insert(rec) Catch ex As Exception strerr_col = ex.Message End Try Return strerr_col End Function

    Read the article

  • SQLCe local db in temp- path in connectionstring?

    - by Petr
    Hi, I have SQL Ce db in my app, which is included in my app directory. While debugging its OK, but when published and run with setup.exe, it retrieves "file not found" in temporary directory the app is ran from. I would like to run from standard location, but I dont know how to change it. I am using this string: SqlCeConnection connection = new SqlCeConnection("Data Source=database.sdf;Persist Security Info=False;"); When I run setup.exe, the app never starts, stating that in its temporary directory the db file was not found. When I run app.exe, it works. I do not understand it...:( EDIT: I can see that in the VS project settings, there is connection string and there is "Data Source=|DataDirectory|\Database.sdf" The path should be something like local directory? Thanks!

    Read the article

  • sqlbulkcopy using sql CE

    - by harrisonmeister
    Is it possible to use SqlBulkcopy with Sql Compact Edition e.g. (*.sdf) files? I know it works with SQL Server 200 Up, but wanted to check CE compatibility. If it doesnt does anyone else know the fastest way of getting a CSV type file into SQL Server CE without using DataSets (puke here)?

    Read the article

  • simple Java "service provider frameworks"?

    - by Jason S
    I refer to "service provider framework" as discussed in Chapter 2 of Effective Java, which seems like exactly the right way to handle a problem I am having, where I need to instantiate one of several classes at runtime, based on a String to select which service, and an Configuration object (essentially an XML snippet): But how do I get the individual service providers (e.g. a bunch of default providers + some custom providers) to register themselves? interface FooAlgorithm { /* methods particular to this class of algorithms */ } interface FooAlgorithmProvider { public FooAlgorithm getAlgorithm(Configuration c); } class FooAlgorithmRegistry { private FooAlgorithmRegistry() {} static private final Map<String, FooAlgorithmProvider> directory = new HashMap<String, FooAlgorithmProvider>(); static public FooAlgorithmProvider getProvider(String name) { return directory.get(serviceName); } static public boolean registerProvider(String name, FooAlgorithmProvider provider) { if (directory.containsKey(name)) return false; directory.put(name, provider); return true; } } e.g. if I write custom classes MyFooAlgorithm and MyFooAlgorithmProvider to implement FooAlgorithm, and I distribute them in a jar, is there any way to get registerProvider to be called automatically, or will my client programs that use the algorithm have to explicitly call FooAlgorithmRegistry.registerProvider() for each class they want to use?

    Read the article

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