|
Dear all,
I had used partial class to extend typed dataset(ex. add a method to TypedDataTable) in my windows-base applications and it works well.
But when I try it in a web services project, those extend functions which is visible within web project, but invisible to client.(I create a windows-base application then add web references point to that web project, client application will not be able to use extend function, properties etc.)
Is it true that Extending a Typed DataSet Using Partial Classes is not available in Web Services Project ?
Or is there anyway to enable it ?
Thanks for help.
|
|
|
|
|
Hi... is there any coding where I can tell a path is a folder or a file?
private void FileOrFolder(string path){
if(){//// condition is path is a folder
}
else if(){/// condition is path is a file
}
else{/// unknown condition.
}
}
|
|
|
|
|
I believe that File.Exists is one way to find out if something is a file.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There is also Directory.Exist in System.IO it is part of File
|
|
|
|
|
in my coding format how should I put it???
if(File.Exist(path)){
}
else if(){ /// Find whether is folder?
}
else{
}
|
|
|
|
|
Assuming you don't already know it's a folder, use Directory.Exists as well.
I assumed you knew it was one or the other, in which case, File.Exists would answer the question
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok thanks...
if it is a folder.. I wish to know whether is there any file inside.. is there a shortest possible coding?
|
|
|
|
|
It's either File.GetAllFiles or Directory.GetAllFiles, returns a string array of file names.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
U means Directory.GetFiles?
but it only get the files. hai. think I there isn't a faster way then.. hehe
|
|
|
|
|
|
Hi,
\
I have two winform classes in question. One has a combobox. When the use picks a selection, it should display this text in the new class. I ahve this working from combobox to combobox and checkedlistbox to textbox but can't figure out combobox to textbox. Please note that the text in the combobox is a concatenated sql string from two columns, Firstname + Lastname as Fullname. I tried putting Firstname in the constructor and also lastname.
In the first form I have used
private void updatebutton2_Click(object sender, EventArgs e)
{
UpdateRole updateRole = new UpdateRole(Convert.ToInt32 (rolecomboBox.SelectedText));
updateRole.Show();
}
The second one I have said
public UpdateEmp(string Fullname)
{
this.Fullname = Fullname;
InitializeComponent();
}
public string Fullname;
private void UpdateEmp_Load(object sender, EventArgs e)
{
this.FirstnameText.SelectedText = Fullname;
}
}
Thanks. Cant figure it out.
|
|
|
|
|
Hi guys, I have the above step working if I store the image from picturebox on the hard drive and then use filestream to save the image. I am trying to skip the step of saving the image on the hard drive and instead save the image straight from the picture box onto a SQL 2000 database. Please help!!!
sasa
|
|
|
|
|
Save the image to a MemoryStream using Image.Save(stream, ImageFormat)[^] method. From the memory stream, you can read the bytes pieces by piece, just like it was a file. Then you can write those bytes to the database.
|
|
|
|
|
Thank you for your response. This works perfect. I appreciate your help.
sasa
|
|
|
|
|
|
I know how to read from the database. I was trying to save straight from the picturebox, either way thanks for your response. I got it to work by using memorystream.
sasa
|
|
|
|
|
I'm modifying my original posting...
If anyone knows of a good *working example* for reading, displaying and filtering as many as 20,000 XML records inside a WinForm, please direct me to said example.
Please do not waste my time with bread crumbs concerning ideas and approaches. I just want a working example. Period.
Thanks in advance! Mark
-- modified at 22:11 Tuesday 4th September, 2007
|
|
|
|
|
First, try loading the records on a background thread. This will allow the program to remain responsive while the records load.
Another thing to try is paging the data in the grid -- show only so many number of rows in the grid at one time (e.g. break the results up into multiple pages like search engines do).
Perhaps the best advice I can give first is, find out where your bottleneck is: loading the data? Creating objects from the data? Binding to the data? Displaying the data in the grid?
Once you locate your bottleneck, you can and should optimize just that part.
|
|
|
|
|
mark_key wrote:
code snippet for 'loading the records on a background thread'?
Look at ThreadPool.QueueUserWorkItem[^] to spawn a thread to execute in the background. That link includes examples in C# and VB.NET how to use the ThreadPool class to execute a function on the background thread.
For you, you simply need to load your XML records in that function. (You said you're already loading the XML records, so I assume we're on the same page there.)
mark_key wrote: code snippet for 'paging data in the grid'?
I rarely use the DataGridView myself, but a quick Google search revealed several articles on CodeProject (complete with source code) regarding how to do this, including this promising one[^].
|
|
|
|
|
I have a main form which launches a second form. The problem is that the second form is always over the first one.
I would like to have them act independently.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
I guess you use ShowDialog() method to show the second form. Instead of that call the Show() method
|
|
|
|
|
I use the Show(). I can give input to the main form, but the second one always overlap it, unless I drag it so it does not overlap.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Then you have to set location of the second form so that they don't overlap
|
|
|
|
|
So if a form launches a second one, the first one can never overlap it? Like switching from one to the other by clicking on the title bar?
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
If you create the second as a child of the first, it will always be above it. If you don't specify a child, they will interchange with one another, based on what you click.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|