|
"An interface is a contract that guarantees to a client how a class or struct will behave. When a class implements an interface, it tells any potential client "I guarantee that I'll support the methods, properties, events, and indexers of the named interface"
So it does not contain any executable code. The method which is getting called is the method what you have implemented. In this case the get()
There may be a question arise when both the interfaces have same method name, return type, argument list and both the methods should be implemented.
At that time you can specify the interface name prior to the definition.
Have a Happy Coding.....
|
|
|
|
|
I want to fill combo box with the values in Excel usind ADO.NET and C# i have written a code bit its not working. Kindly help.
private void FillAccounts()
{
try
{
string excelFile = @"C:\Capacity Planning\Accounts.xls";
//String sConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + @"C:\Capacity Planning\Accounts.xls" + ";Extended Properties=Excel 12.0 Xml;HDR=YES;:Max Buffer Size=256;";
String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + excelFile + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'";
OleDbConnection objConn = new OleDbConnection(sConnectionString);
objConn.Open();
OleDbCommand objCmdSelect = new OleDbCommand("SELECT Account,Link FROM [Accounts$]", objConn);
OleDbDataAdapter objAdapter = new OleDbDataAdapter();
objAdapter.SelectCommand = objCmdSelect;
DataSet objDataset = new DataSet();
objAdapter.Fill(objDataset);
cbAccounts.DataSource = objDataset.Tables["Accounts"];
cbAccounts.DisplayMember = "Account";
cbAccounts.ValueMember = "Accounts.Account";
objConn.Close();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
Thanks a lot in advance
shantanu
|
|
|
|
|
Hi
When changing a value in any cell in DataGridView , this value is saved into the related dataset only after the user clicks on an other cell in an other row !
Even the mecthod AcceptChanges() will not save the contents of this cell unless the user moves to an other row . I need to save these contents straight away without forcing the user to leave the cell .
any Ideas ?
thanx .
|
|
|
|
|
unitecsoft wrote: without forcing the user to leave the cell
How will you know when the user is finished with editing then? Saving the current value at each keypress is going to be inefficient
I are troll
|
|
|
|
|
the problem is even if you save by clicking a SAVE button which will fire AcceptCanges() method , the contents of the cell are not saved unless the user previously leaves the row which include that cell .
|
|
|
|
|
If he clicks a save-button, doesn't that move the focus to the button (and out of the cell, triggering validates and such)?
I are troll
|
|
|
|
|
Yes , but does not save the value of that cell !!! I don't know why !!!
the only way to save it is to click a different ROW within the grid .
|
|
|
|
|
That shouldn't be happening, according to the documentation;
"When you call AcceptChanges on the DataSet, any DataRow objects still in edit-mode end their edits successfully." (Source[^])
Can you post the offending code?
I are troll
|
|
|
|
|
Hi all...
I've got a problem with a crystal report app (Delphi) and I need Help. I got the following code to work on two machines but it keeps failing on the client server. Can someone tell me why. PS The client server works with a XBase driver the two Machines I got it to work on runs a foxpro driver. That is the only thing I can pick up thats different...
dtmVision.crGeneric.Tables.ItemIndex :=0;
dtmVision.crGeneric.Tables.Item.Name :='System.dbf';
dtmVision.crGeneric.Tables.ItemIndex :=0;
dtmVision.crGeneric.Tables.Item.Path :=sDBPathForVision;
dtmVision.crGeneric.Tables.ItemIndex:=1;
dtmVision.crGeneric.Tables.Item.Name:='Customer.dbf';
dtmVision.crGeneric.Tables.ItemIndex :=1;
dtmVision.crGeneric.Tables.Item.Path :=sDBPathForVision;
dtmVision.crGeneric.Tables.ItemIndex := 2;
dtmVision.crGeneric.Tables.Item.Name :=sFnTempTRans;
dtmVision.crGeneric.Tables.ItemIndex :=2;
dtmVision.crGeneric.Tables.Item.Path :=ExtractFilePath(sFnTempTRans);
crGeneric is of type TCrpe
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Sorry wrong form ignore this post please
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
download the checked record from the gridview using c#
|
|
|
|
|
Is this a question?
I assume that the checked record represents a file or sth similar. If you press a button like "Download" you can catch the event in your code behind and send the file content as response.
Regards
Sebastian
|
|
|
|
|
when i click download button the checked file in gridview will download using asp.net and c#
|
|
|
|
|
Now, which seems more likely to you - that this question will be answered in the C# forum where lots of people have NO knowledge of ASP.NET, or the ASP.NET forum?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
|
Rahad Rahman wrote: give me solution
Get stuffed. If you can't use google, can't read a book, can't use intellisense, have no idea how C# or winforms works, and can't even ask nicely, then why should we help you ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hear hear.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Rahad Rahman wrote: give me solution
Call 911
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Look into System.Drawing.Image.Save and System.Drawing.Image.FromFile. That's all you'll be getting from me though. "Give me solution" is hardly acceptable post content - its rude and rather annoying. Besides, the only person who can help you now is a shrink
|
|
|
|
|
You already asked this question yesterday
You didn't even bother to read those reply's did you, hell all you did is switch the subject and content. And if you did read the reply's you either didn't understand them or you chose to simply ignore them.
If you didn't understand them what make's you think you'll understand it now?
'give me solution' sounds allot like an order, I don't take orders from forums (neither does anyone else around here)
|
|
|
|
|
hmmm what would help? reading a book? maybe about c#?
|
|
|
|
|
Im trying to learn how to attach a file to the form..The idea
is, the user can not only add a record but will also be able to add an
attachment for that particular record....lets say I would like to add
an excel or word doc...this has nothing to do with sending attachments
and emails and stuff like that...just attaching a file to the form...
plz help!
|
|
|
|
|
You may use the DataGridViewImageColumn to add a small picture and write a delegate to open a file you wish to open, when the picture is clicked.
Otherwise physically attaching a file is only valid in e-mail and other messaging services...
Have a Happy Coding.....
|
|
|
|
|
Hi
I am using this code to list the files in ListView control.When i try to add the files to the listview control using
listView1.Items.Add(fil2.ToString());
it gives me only one file i.e the last file in the folder.What change should i do to list all the files in that folder?Please help me with this
amespace WindowsApplication30
{
public partial class Form1 : Form
{
XmlTextReader reader;
XmlDocument doc = new XmlDocument();
ColumnHeader colHead;
String sss = "";
public Form1()
{
InitializeComponent();
}
private void ListDrives_Click(object sender, EventArgs e)
{
string[] drives = Environment.GetLogicalDrives();
foreach (string strDrive in drives)
{
listBox1.Items.Add(strDrive.ToString());
}
}
private void ShowPath_Click(object sender, EventArgs e)
{
CreateHeadersAndFillListView();
PaintList(sss);
}
private void CreateHeadersAndFillListView()
{
colHead = new ColumnHeader();
colHead.Text = "Servers";
colHead.Width = 200;
listView1.Columns.Add(colHead);
colHead = new ColumnHeader();
colHead.Text = "Status";
colHead.Width = 100;
listView1.Columns.Add(colHead);
colHead = new ColumnHeader();
colHead.Text = "Last accessed";
colHead.Width = 100;
listView1.Columns.Add(colHead);
}
private void PaintList(String sss)
{
try
{
reader = new XmlTextReader("path.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Text:
String s1;
s1 = reader.Value;
String ss;
ss = listBox1.SelectedItem.ToString();
sss = ss + s1;
object o3 = (object)sss;
DirectoryInfo dire = new DirectoryInfo(sss);
if (dire.Exists)
{
String[] folder;
folder = Directory.GetDirectories(sss);
foreach (string foldername in folder)
{
DirectoryInfo di = new DirectoryInfo(foldername);
if (di.Exists)
{
String[] files;
files = Directory.GetFiles(foldername);
listView1.Items.Clear();
foreach (String filename in files)
{
FileInfo fil2 = new FileInfo(filename);
listView1.Items.Add(fil2.ToString());
}}}}
break;}}
}
catch (System.Exception err)
{
MessageBox.Show("Error: " + err.Message);
} }} }
|
|
|
|
|
What happens when you step through the code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|