|
|
|
Hello folks,
I have a C# application which contains an interesting function using a SQL command, essentially it goes like this
INSERT INTO Table C (Name)SELECT DISTINCT Name from [Table A]WHERE Name NOT IN (SELECT DISTINCT Name FROM Table B
This runs on 2005 express SQL and works fine, what this does is effectively pull values from one table column which
are not already in another table with the same column and then insert them into a third table.It is a long story.
I need a way to accomplish this in an applicaton being written using SQL CE 3.5 which does not support sub queries on nText data.
LINQ is out of the question as well due to SQL CE.
Any ideas ? All help greatly appreciated, not sure which way to go with this hence posting in C# forum. 
|
|
|
|
|
Might help to switch to NVARCHAR , as that's the type that's used to store queryable texts. NTEXT is a large text, more used in full-text searches and less in queries (as they often contain more data, and querying blobs tends to be slow)
I are Troll
|
|
|
|
|
Thanks,
I shall try and get back to you with a result
|
|
|
|
|
So, you can perform each query on it's own, and process the data in your application? Or are you trying to figure out why it doesn't work?
Craigslist Troll: litaly@comcast.net
"I have a theory that the truth is never told during the nine-to-five hours. "
— Hunter S. Thompson
|
|
|
|
|
This query does work when run as a sql command against a 2005 express
database, changing to nvarchar has removed the error due to the type
incompatability, thanks.
However when I ran the command from the app it had legal syntax but no affect ?
So i pasted it into the sql pane and intllisense altered the statement to this
INSERT INTO Table_C<br />
(Name)<br />
SELECT DISTINCT Name<br />
FROM Table_A<br />
WHERE (Name NOT IN<br />
(SELECT DISTINCT Name<br />
FROM Table_B AS Table_B_1))
This SQL command now works, i will have to do some homework on why that change is required for SQL CE 3.5
and not in SQL 2005 express 
|
|
|
|
|
Hi all,
I am having one c++ dll and when i am try to add as a reference in c# application it is giving and error.
How can i use it in my c# application ?
Can you suggest me any method instead of using "dllimport and external" methods.
Thanks in advance.
|
|
|
|
|
sarang_k wrote: Can you suggest me any method instead of using "dllimport and external"
methods.
Unless you want to write a C++/CLI implementation of your C++ function, or provide a C++/CLI version to act as a bridge, there is no other mechanism you can use (discounting you providing COM interfaces in your C++ code for your C# to hook into).
The PE header for .NET assemblies is different to the PE header for other libraries, which means that you can't add a none .NET assembly in as a reference.
|
|
|
|
|
Hi guys,
How can I rename my file defined by my string Path?
I want to pass from :
TXTFile_rfcyxt55efrem1fj4sycjv5527-04-2011_17h-4641_0.txt
to
Entite1.txt
ty for u help
modified on Thursday, April 28, 2011 4:47 AM
|
|
|
|
|
|
Hi,
File.Move is good solution also File.CopyTo(olderpath, NewPath) is also well working)
Ty
|
|
|
|
|
file raname using Regex
like this
newfilename = Regex.Replace(fDialog.FileName, "F.NCF", "H.NCF");
|
|
|
|
|
That just changes strings. It doesn't touch the file at all.
|
|
|
|
|
Hi,
RDLC print icon not displayed in Mozilla Firefox, its working fine in IE. what is the issue
Thankyou,
ypki
|
|
|
|
|
I'm sorry, but you've picked the wrong forum for your question. Would you like to move it to a more appropriate forum please?
|
|
|
|
|
which is the forum where i can ask about the RDLC?
|
|
|
|
|
|
I found this thread[^] having same discussion with solutions.
|
|
|
|
|
Hi,
I am filling a combobox with the code below:
private void frmCrearCooperativa_Load(object sender, EventArgs e)
{
string nacionalidad = "select * from cs_nacionalidad";
try
{
//open connection
bdConex.OpenConnection();
//create command and assign the query and connection from the constructor
MySqlDataAdapter da = new MySqlDataAdapter(nacionalidad, bdConex.conn);
//create dataset
DataSet ds = new DataSet();
// filling dataset
da.Fill(ds, "cs_nacionalidad");
//dataset values
cboNacionalidad.DataSource = ds.Tables["cs_nacionalidad"];
cboNacionalidad.DisplayMember = "nm_nacionalidad";
cboNacionalidad.ValueMember = "cd_nacionalidad";
//close connection
bdConex.CloseConnection();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
how do I can do a class that fills the combobox with this code?
because I have to write it down in all forms.
thanks.
|
|
|
|
|
I dont have your answer but, If you would like the guys who know more than me to answer you might want to edit your post and put the code in a code block
code here by using pre tags to make it easier to read.
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
you only need to pass dataset object
EASY COME EASY GO
|
|
|
|
|
You can just create a method that accepts a combobox as parameter. and then inside your method, just do the usual setting of the datasource to your combobox, just like what you are doing in your code. Im not sure though if your data source for your combo boxes will be the same. If it isn't, you might want to add parameters for your datasource, displaymember, and valuemember to your method.
Ignorance of the ability brings disability.
|
|
|
|
|
You can create a class, that derives from ComboBox, and there you do
protected override void OnLoad(EventArgs e)
{
string nacionalidad = "select * from cs_nacionalidad";
try
{
bdConex.OpenConnection();
MySqlDataAdapter da = new MySqlDataAdapter(nacionalidad, bdConex.conn);
DataSet ds = new DataSet();
da.Fill(ds, "cs_nacionalidad");
cboNacionalidad.DataSource = ds.Tables["cs_nacionalidad"];
cboNacionalidad.DisplayMember = "nm_nacionalidad";
cboNacionalidad.ValueMember = "cd_nacionalidad";
bdConex.CloseConnection();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
And then use this class, where you want ComboBox to contain this data.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
how do I call the class with the combobox as a parameter?
Thanks
|
|
|
|