|
hi
i want to write Client/Server Programming database with vc#2005 & sql2005 or 2000, but how to connect to sqlserver from network and how to insert,Update,Delete transaction in my database on the network??
Please get me an article or full description on this topic.
thanks..
|
|
|
|
|
hdv212 wrote: i want to write Client/Server Programming database with vc#2005 & sql2005 or 2000, but how to connect to sqlserver from network and how to insert,Update,Delete transaction in my database on the network??
Please get me an article or full description on this topic.
Again, your question is pretty vague.
You can use the SqlConnnection class and related objects to connect to an SQLServer via the network. The connection string determines which server to connect to. This[^] covers the standard ways of connecting to the various server configurations.
As for the Insert/Update/Delete, I use stored-procedures that are executed from SqlCommand objects.
The Microsoft Enterprise Library Data Application block[^] is my preferred method of writing DB code.
|
|
|
|
|
Add the server to Visual Studio's server list, and drag and drop.
|
|
|
|
|
hi
does anyone say to me How to acess Sql Server 2005 Reporting Services's Fields and how to get/set it's Values ?
i went many ways for this work but i don't get true results.
Please write a code that i can access to reporting srvice and get/set its values.
thanks
|
|
|
|
|
hdv212 wrote: does anyone say to me How to acess Sql Server 2005 Reporting Services's Fields and how to get/set it's Values ?
i went many ways for this work but i don't get true results.
Please write a code that i can access to reporting srvice and get/set its values.
Your question is a little vague.
Reporting services is usually programmed via it's web-service.
See here[^] for more details, including examples.
|
|
|
|
|
my question:
i read the book of " Schaum’s outline series , THEORY AND PROBLEMS OF DATA STRUCTURES" BY SEYMOUR LIPSCHUTZ.
it is a cool book but in it’s programming problems he want program like in ch5
can any one help tell me if i can make it by c#
or how can i find the answers of this problems
thanks lot
answer:
amirafouad21 wrote:
he want program like in ch5
This makes no sense.
amirafouad21 wrote:
can any one help tell me if i can make it by c#
You can do pretty much any programming problem in C#.
amirafouad21 wrote:
how can i find the answers of this problems
Sounds like you are asking for homework answers. This is a no-no. Also, please title your posts more appropriately rather than just using 'help.'
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
is there any one can help, because i born any one said homework is there any one have a good answer for me not a homework
|
|
|
|
|
You must be specific about your problem. Don't assume that everyone has that book and they will turn the page to chapter 5 and go through the entire chapter to find out which problem you are talking about.
Also I've noticed your previous thread, and honestly I have no idea why did you copy-paste the response to your previous thread? You could have just stated that this is not a homework!!
Bottom line:
1- As you are new to the forums -from your profile-: Welcome to CodeProject.
2- Before posting again in the forums please review these posting guidlines[^]. And I specially mean the be specific part of the guidlines.
3- If you are still stuck in your problem, post exactly what you are stuck in, and we will happily lend a hand if we could.
Regards
|
|
|
|
|
Thanks Nader Elshehabi very much for your reply , but i try to be specific in my question .
the question in liked list in data structure, the problem is that i want an algorithm or code in c# for this case that say write a program which reads an integer K and prints the list of clients of lawyer K and test the program for each K.
i know there is a pointer in c# but how i can make it.
very thx Nader Elshehabi and i hope u can help me
thanks
|
|
|
|
|
First of all; You are always welcome.
Now to your issue:
The summary of your problem is that you want to implement a linked list data structure in C#. Right? Whatever is stored in that linked list -in my following example I will make a sample lawyer object to demonstrate linked lists in C#-, you don't need to use pointer. Yes you can use pointers in C#, but you absolutely don't need them.
I'd like to remind you that objects -ie. instances of classes- are reference type. That means -assuming you made a class named lawyer-:
Lawyer A = new Lawyer();
Lawyer B = A;
Here A, and B are the same lawyer. If you change anything in A it will also change in B and vice versa. So to implement linked lists in C# -using references to objects instead of pointers-, here is a samll sample:
namespace MyNameSpace
{
class Lawyer
{
public string Name;
public string Address;
public string Telephone;
public Lawyer Previous;
public Lawyer()
{
}
}
}
You can now use your Linked list as a stack -First In Last Out-, or a queue -by adding another reference to the Next item-. I believe you made some reading in Data structure and you can get going from here. Here is a small sample of using the above very simple linked list:
Lawyer LastItem = new Lawyer();
for(int I = 0; I <10; I++)
{
Lawyer another = new Lawyer();
another.Previous = LastItem;
LastItem = another;
}
If you still need clarification about anything, just post.
Regards
|
|
|
|
|
very very very thanks Nader relay very thanks,
I am sorry, did u mean i can make like this code, i am sorry again for asking
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Lawyer
{
public string Name;
public string Address;
public string Telephone;
public Lawyer Previous;
public Lawyer()
{
}
}
class Program
{
static void Main(string[] args)
{
Lawyer LastItem = new Lawyer();
for (int I = 0; I < 10; I++)
{
Lawyer another = new Lawyer();
another.Previous = LastItem;
LastItem = another;
}
Console.WriteLine();
}
}
}
-- modified at 12:11 Tuesday 28th November, 2006
|
|
|
|
|
Well, eventually yes. This was just a small test of adding 10 items consecutively to the linked list using a loop. You can use it largely as a stack -I assume you know the difference between a stack and a queue-. In real life you'd be using more complex linked lists -if wou'd use them at all-.
If you get errors or have trouble again, don't hesitate to post.
Regards
|
|
|
|
|
Hi,
Does anyone have some idea about how to implement parent/children rows in Datagrid control if I bind ArrayList to the datagrid.
I want to fold the children rows in some cases. also the parent have similar data structure as children.
Thanks in advance!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
The MS provided GridView doesn't support this so you'll need to use a control such as Infragistics' UltraWebGrid or write a lot of display code yourself.
only two letters away from being an asset
|
|
|
|
|
hi to all
can anybody explain about overload,override,abstract with example code
thanks in advance
regards
saravanan
|
|
|
|
|
An overload is having 2 methods named the same, but which provide a differing number of arguments. This is useful in many ways and can simulate optional arguments
public void DoSomething()
{
DoSomething(true);
}
public void DoSomething(bool special)
{
}
An override is used to redefine a virtual method from a base class. This allows you to change the behaviour of your objects.
class MyBase
{
public virtual void DoSomething()
{
MessageBox.Show("Something from MyBase");
}
}
class MyDerived : MyBase
{
public overload void DoSomething()
{
MessageBox.Show("Something from MyDerived");
}
}
An abstract class is one that cant be directly instantiated, it must be inherited and given default behaviour for all abstract members.
|
|
|
|
|
Typo: overload should be override
J4amieC wrote: class MyBase
{
public virtual void DoSomething()
{
MessageBox.Show("Something from MyBase");
}
}
class MyDerived : MyBase
{
public overload void DoSomething()
{
MessageBox.Show("Something from MyDerived");
}
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Yup, sorry and well picked up...
|
|
|
|
|
Overloading :
a particular operator / method doing different tasks:
Same method name, Different parameters.
example: method overloading
public void PrintString(String str)
{
Console.WriteLine(str);
}
public void PrintString(int n)
{
Console.Writeline(n.ToString());
}
In the above example PrintString method is overloaded, that is there are two methods that differ by parameter. This is mandatory for overloding, i.e the method parameters must differ. if just the return types differ, the code will not compile. There is no keyword called overload.
Overriding:
If we have a method in our class and feel there is possibility that any class that inherits our class might need to implemt our method in a different way, we have to make our method virtual. Only abstract / virtual methods can be overridden.
public class classa
{
protected virtual void MyMethod()
{
//some code
}
}
public class classb: classa
{
protected override void MyMethod()
{
//slightly different code
}
}
Abstract:
Abstract methods are those that have no implementation, abstarct methods can reside only in abstract classes, and any class which inherits the abstract class "MUST" override the abstract method and give proper implementation.
hope this helped.
Baba thts what they say, B to the A to the B to the A
|
|
|
|
|
Hi,
Im trying to detect when user changes the order of a DataGridView to after that select the right row again due RowIndex changes. Before it i have my Row selected by a field on the Cell Table. Seems easy but im not able to find the event o something telling me "Hey dude, user changed order clicking at headers, i finished painting and you should re-select the right row again"
Hope you catch me and somebody nows how to do it,
Sorry about my english and many thanx in advance,
|
|
|
|
|
Before doing the sort, save a reference to your key field. Do the sort. Find the key value from your key field to select it.
|
|
|
|
|
Hi, thanx but i had the reference already, the problem is to find which event is fired after a header column sort to place the selected row index again.
|
|
|
|
|
have you checked DataGrid1_SortCommand ?
|
|
|
|
|
I saw SortedColumn & SortOrder, but I dont mind about the order, i need to be notify at my code when the user clicks into the header, systems re-sort the datagrid and then it should call me to put the selected row again to the right index.
|
|
|
|
|
Then between my 2 posts, you have the answer to your question.
|
|
|
|
|
DataGrid1_SortCommand ???
I saw that event but cant see it at DataGridView. Maybe im an absolutely n00b.
Thanx for your help,
|
|
|
|