|
I already tried it.. but, doens´t work as well..
thanks!
|
|
|
|
|
My task is to fill a DataSet from a data source and update another data source
in C#.
For example I have two databases in SQL Server (i.e. db1 and db2).
I have table named ProdMkt_Contrib_Link in db1 with following columns:
ProdMkt_Contrib_Link
--------------------
ProdMktContributorID (PK)
ProductMarketID
Priority
Inactive
Contrib_Type_Override
ProdMkt_Contrib_Link_ID
The above columns data should be mapped/sync to the table named
ProdMktContribLink in db2:
ProdMktContribLink
------------------
ProdMktContributorID (PK)
ProductMarketID
Priority
InactiveFG
ContribTypeOverRide
AcumenProdMktContribLinkID
Note: The table name and few column name are different
Suppose few records are added and few are updated in the
db1.ProdMkt_Contrib_Link table.
I have filled the typed DataSet (DS1) with db1.ProdMkt_Contrib_Link (this
contains only added and updated records) ans also filled the another DataSet
(DS2) with db2.ProdMktContribLink (this contains all records).
Now I want that DS1 should be sync with the DS2. That is, the added records
should be added to the DS2 table rows and also updated records should be updated
to the DS2 table rows.
How can I achieve this in c#. Please suggest any good design or sample code.
Thanks,
Kamran
|
|
|
|
|
Will this get value dashboardid from table into variable 'str'?
int str = "select dashboardid from dashboardlogin where userid=101";
dashboardid is 'int' type in database.
but i have error if i use this:
Cannot implicitly convert type 'string' to 'int'.
do i need to add any other code also for getting its data into variable 'str'?
plz reply
thank you.
nekshan.
|
|
|
|
|
hey this is wrong , either u write a stored procedured which will return a parameters from stored procedures..
or execute the query.
get the result set in to datatable and get ur value from there.
Ravi Kant Srivastava
(System Analyst)
HandsOn Technology & Engineering
Gurgaon
(India)
e-mail:ravikant@hte.co.in
|
|
|
|
|
Your statement getsthe query string into the string variable str . The compiler error occurs, because str is declared as an int .
If you want to use LINQ to query the datasource, try this article:
http://www.codeproject.com/useritems/SudokuSolver.asp[^]
Otherwise you have to connect to the database and query it with an SqlCommand :
<br />
using (SqlCommand selectCommand = new SqlCommand("select dashboardid from dashboardlogin where userid=101", connection))<br />
{<br />
object objResult = selectCommand.ExecuteScalar();<br />
if (objResult != null)<br />
{<br />
int str = (int)objResult;<br />
}<br />
}<br />
____________________________________
There is no proof for this sentence.
|
|
|
|
|
You got it all wrong.
Please read a database tutorial.
Just a hint. Someone must execute the desired sql command , don't you think?
Its just as you have written
int a="Hello World";
the you just happen to have for text an a sql command.
Read the db tutorial.
|
|
|
|
|
How to do the implementation of interfaces (written using .Net) between front and Back Office applications.
Kindly assit me ASAP as i have the Client Interview On this.
Thanks and Regards
Naveen Kumar S
Naveen
|
|
|
|
|
use implements keyword and mention the interface name you name want to implement for that class
class a implements interface a, interface b
...
...
*make sure all the methods of the implemented interfaces have been defined
Gautham
|
|
|
|
|
class a : b { ... }
"implements" is Java !
Luc Pattyn
|
|
|
|
|
Hi Friend!
From table 'dashboardlogin', i want an int type value : 'dashboardid' of a particlar row(suppose where userid =101), into a variable suppose 'str', so that i can display that variable in a function :
funEntrylogin(str, tb_id.Text, tb_pswd.Text, DateTime.Now, DateTime.Now);
Is this possible?
Can some1 plz help on it.
Thank you.
nekshan.
|
|
|
|
|
select @str=dashboardid from dashboardlogin where userid=101
Gautham
|
|
|
|
|
Will this get value dashboardid into variable 'str'?
int str = "select dashboardid from dashboardlogin where userid=101";
dashboardid is 'int' type in database.
but i have error if i use this:
Cannot implicitly convert type 'string' to 'int'.
do i need to add any other code also for getting its data into variable 'str'?
plz reply
thank you.
nekshan.
|
|
|
|
|
nekshan,
your variable str should also be the same type of the column, here your coulmn datatype is int, so declare @str int and try.
Check whether the dashboardid datatype in your table!!!
Gautham
|
|
|
|
|
Hi,
In am developing windows mobile 5.0 application using VS2005 C#.NET Compact framework(2.0).Is it support to treeview.Backcolour or not?..If not supporting any other alternate source?..Please tell me..
Thanks in Advance
Bye
|
|
|
|
|
can u plz tell me how to make the treenodes collapse on a single click. I want to make a menu based on a tree view in a C# 2.0 windows Application. so the problem is that it need double click to collapse a tree node. In the after select event I tried to puit the statement e.Node.Collapse(); but it doesnt seem to be giving the result I want so can u help me?
thanks alot
Rocky
|
|
|
|
|
maybe Expand() or ExpandAll() ?!
VirtualVoid.NET
|
|
|
|
|
Hmm try this... For collapse use CollapseAll() And for expand use
ExpandAll() method e.g TreeView1.CollapseAll()
Q@!$3r
|
|
|
|
|
hmm alright.. I'll chk out what that does, just wondering whats the difference b/w collapse and expand
thanks alot
Rocky
|
|
|
|
|
Hy
I have a remote application and I need to send to server an object who is a window control, and I can't do that.
If i send to server a string, it's works
Can tell how can I send an object like a window control to a server for my application?
The server know to serialize and deserialize.
10x
|
|
|
|
|
My object has a List<Color> property that I want the user to be able to edit. I was presenting all the object's properties in a PropertyGrid and this was working fine. I've since decided that I no longer need the user to see the other properties; only the List<Color>. So there's no longer a need for a propertygrid.
Anyone have any ideas how I could perhaps use the Collection Editor at runtime, outside of the propertygrid, or some other method of presenting the color collection to the user for editing without having to implement my own dialog.
Thanks
|
|
|
|
|
hi
you can hide properties in the propertygrid with the Browsable attribute set tu false.
example:
[System.ComponentModel.Browsable(false)]
public int MyProperty
{
get {return myProperty;}
set {myProperty = value;}
}
|
|
|
|
|
Hello,
I have a problem when using MS Visual Studios 2005 build in DataSet Designer. In my App I want to work with two related tables, one Parent and one Child table.
ParentTable
-----------
ParentID (pk)
ParentName
ChildTable
-----------
ChildID (pk)
ChildName
ParentID (fk)
When I do this the old fashion way (not using the designer), I have no problem accessing the Child records related to the Parent record im working with. Here's the working code:
DataRelation parentChildRelation;
DataColumn colMaster;
DataColumn colDetail;
colMaster = parentChildDataSet.Tables["Parent"].Columns["ParentID"];
colDetail = parentChildDataSet.Tables["Child"].Columns["ParentID"];
parentChildRelation = new DataRelation("parentChildRelation", colMaster, colDetail);
parentChildDataSet.Relations.Add(parentChildRelation);
Now i can access the relation using
parentRow.GetChildRows(relation, DataRowVersion.Default);
But when I do the same thing but using the DataSet designer (adding the two tableadapters for the Parent and Child table and adding a relation between them from the DataSet Toolbox) I can't access the relation in my code.
I have looked in the Designer.cs and it adds the code for the relation:
this.relationParent_Child = new System.Data.DataRelation("Parent_Child", new System.Data.DataColumn[] {
this.tableParent.ParentIDColumn}, new System.Data.DataColumn[] {
this.tableChild.ParentIDColumn}, false);
this.Relations.Add(this.relationParent_Child);
But still a call like this: parentTable.ChildRelations; ends up empty..
Anyone have any idea why?
/Thanks - Martin
|
|
|
|
|
Hi all,
Can anyone provide me with good link to learn classes for window based programming. Well i know the concept of it but finding difficulty when i try to implement it.
I couldn't find any good link for that.
I would be glad if someone help me out in this.
Thanks
|
|
|
|
|
Classes are not only for window based programming as you call it.
Classes are one of the tools to implement what is generally known as object oriented programming.
Look it up on google.
Generally OOP is mastered with expierence for me.
|
|
|
|
|
yeh i know this. The reason i asked for window based is because i want to create a windows based application. So even few simple things matters a lot in that.
Well i have googled but not getting any good material for it. There are just a simple examples of classes, i need some good examples.
But still ill try and search in google....
Thanks
|
|
|
|