|
hi troll
how to transfer values from one datatable to another datatable. For example there are 2 datatables Table A and Table B. If then column name in Table A is the same as Table B then all the values of that column will go into Table B of the same column name.
Hope you understand me.
Thank you
zheng
|
|
|
|
|
|
hi troll
thank you for replying i would like to copy values of a column in the dataset to another column in another dataset. the condition is: if the both column name is the same.
thank you!
|
|
|
|
|
shoubi wrote: the condition is: if the both column name is the same
..and do you know how to check that?
I are Troll
|
|
|
|
|
hi troll
thank you for your help... i managed to do it!
thank you!
zheng
|
|
|
|
|
shoubi wrote: thank you for your help... i managed to do it!
I wasn't much help, so the credit is yours - well done
I are Troll
|
|
|
|
|
hi troll
i need your help again. how do i insert the dataset into the database.
here is my code:
string SelectSchema = "SELECT * FROM [Package Data Range]";
DataSet ds = new DataSet();
OleDbDataAdapter adapterPkInfo = new OleDbDataAdapter(SelectSchema, ImportCon);
adapterPkInfo.FillSchema(ds, SchemaType.Source, "PackageDataRangeSchema");
DataSet ds2 = new DataSet();
string selectPkInfo = "SELECT * FROM [Package Data Range]";
OleDbDataAdapter adapter = new OleDbDataAdapter(selectPkInfo, connection);
adapter.Fill(ds2, "Package Data Range");
ds.Tables[0].Merge(ds2.Tables[0],true,MissingSchemaAction.Ignore);
i would like to insert the dataset ds into the database.
thank you
zheng
|
|
|
|
|
hi troll
I have another question, however it is not related to this. Hope you can give me your professional advice.
I have a C# dll, I want to call it from a C++ program. How do I import this dll into the C++.
thank you
|
|
|
|
|
shoubi wrote: I have another question, however it is not related to this.
No problem, but you would have gotten more reactions if you created a new post.
shoubi wrote: How do I import this dll into the C++
Using a Platform Invoke[^] would be the easy way to call unmanaged code. If you want to wrap an existing unmanaged type, then look here[^].
Enjoy
I are Troll
|
|
|
|
|
Hi,
I need to notify any exception in the worker thread to the main/ calling thread. How to achieve this and what is the best way to do it.
Googled around and came to know that the exceptions in the worker thread are not handled by the main thread.
Thanks,
Praveen Raghuvanshi
Software Engineer,
India.
|
|
|
|
|
Hi,
You can use 'Application.ThreadException'. it will handle any unhandled exception that raises in a sub-thread, anyway this only allows you to have a application wide event for handling all your sub-threads. Maybe you can create an event yourself and call it on the catch block. This way you control the exceptions on the sub-thread and send it to UI thread.
Hope this helps.
|
|
|
|
|
Thanks Gonzalo!
I have tried above mentioned event mechanism. Just thought of something better available.
Praveen Raghuvanshi
Software Engineer,
India.
|
|
|
|
|
You welcome .
I guess then the only way would be you taking care of picking the expcetion in the sub-thread and moving it to UI manually.
Regards.
|
|
|
|
|
Hello.
In the database tree structure of how to write?
After the move in the C#
|
|
|
|
|
From your description of the problem, no.
Please clarify your question - in English it does not make a lot of sense...
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Hello.
In the database tree structure of how to write?
After the move in the C#
|
|
|
|
|
Can you please give some detail, so that it is easier to answer your question.
And please don't cross post. Read this[^] guideline before you post your question.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi,
I am building a GPS assisted application, which is to display a weather forecast for the closest location with reference to current location.
I am using yahoo weather forecasts.
What i have done:
1. I can successfully request a weather for a place if i know its WOEID (Note: only some places have weather forecasts).
2. In order to get a WOEID of the current location i can query "FLICKR" using YQL and passing current latitude and longitude and get a WOEID back for that place.
Problem:
Is there any way i can request a weather forecast for a nearest location to acquired WOEID of current location.
Thank you in advance,
|
|
|
|
|
Hi Guys,
I would appreciate it if someone has found/created an MS Word Viewer/Editor Control on Visual Studio.
Thanks,
|
|
|
|
|
If you are looking for a word .doc editor in C#, you can find several on the internet. See here.
My signature "sucks" today
|
|
|
|
|
Hey guys, I'm having trouble searching for a date I fetch in C# in my database
in my application the date time value is in this format: 6/16/2010 9:41:19 AM in the database I use
CONVERT(VARCHAR(10),SR.StuDateOfReg,101) to convert my date and extract only the date part but what I get is 06/15/2010.
I thought there should be no difference between 6/16/2010 and 06/16/2010,
when I execute this query
... WHERE CONVERT(VARCHAR(10),SR.StuDateOfReg,101) >= CONVERT(VARCHAR(10),'6/15/2010',101)
I don't get anything back but when I go for
... WHERE CONVERT(VARCHAR(10),SR.StuDateOfReg,101) >= CONVERT(VARCHAR(10),'06/15/2010',101)
It works!
so how can I change one to another?
regards,
|
|
|
|
|
Found it myself
I used this function:
CREATE FUNCTION dbo.fnFormatDate (@Datetime DATETIME, @FormatMask VARCHAR(32))
RETURNS VARCHAR(32)
AS
BEGIN
DECLARE @StringDate VARCHAR(32)
SET @StringDate = @FormatMask
IF (CHARINDEX ('YYYY',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'YYYY', DATENAME(YY, @Datetime))
IF (CHARINDEX ('YY',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'YY', RIGHT(DATENAME(YY, @Datetime),2))
IF (CHARINDEX ('Month',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'Month', DATENAME(MM, @Datetime))
IF (CHARINDEX ('MON',@StringDate COLLATE SQL_Latin1_General_CP1_CS_AS)>0)
SET @StringDate = REPLACE(@StringDate, 'MON',
LEFT(UPPER(DATENAME(MM, @Datetime)),3))
IF (CHARINDEX ('Mon',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'Mon', LEFT(DATENAME(MM, @Datetime),3))
IF (CHARINDEX ('MM',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'MM',
RIGHT('0'+CONVERT(VARCHAR,DATEPART(MM, @Datetime)),2))
IF (CHARINDEX ('M',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'M',
CONVERT(VARCHAR,DATEPART(MM, @Datetime)))
IF (CHARINDEX ('DD',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'DD',
RIGHT('0'+DATENAME(DD, @Datetime),2))
IF (CHARINDEX ('D',@StringDate) > 0)
SET @StringDate = REPLACE(@StringDate, 'D', DATENAME(DD, @Datetime))
RETURN @StringDate
END
dbo.fnFormatDate (SR.StuDateOfReg, 'M/DD/YYYY') >> 6/15/2010
|
|
|
|
|
That's not a good design. Change the data type for your date time values to 'datetime'. Furthermore, use parameterized queries. Then your problems should be easily resolved without long functions.
|
|
|
|
|
That is horrible. Don't use strings for dates (or numbers); it's terribly inefficient, especially when you convert the data in the table to strings and then compare -- don't do it!
Convert the incoming string to a date and then compare.
|
|
|
|
|
i want to move a button on a form with a keypress on keyboard.
please help me
what should i do?
danialkhazaei@yahoo.com
|
|
|
|
|