|
hi,
use following statement
DirectoryInfo obDir = new DirectoryInfo(MainDataDirectoryPath);
obDir.Create();
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
we can create a a folder by using the statement
Directory.SetCurrentDirectory("C:\\");
Directory.CreateDirectory("Foldername");
Direcotry is a class which is under the System.IO namespace.
|
|
|
|
|
It's just
System.IO.Directory.CreateDirectory(@"c:\my directory");
no need to set the current directory ( which is a bad thing to do anyhow, as it can stop the other code from working )
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 )
|
|
|
|
|
Please - test to see if the directory exists before you attempt to create it:
if (!Directory.Exists(@"c:\foobar"))
Directory.CreateDirectory(@"c:\foobar"); Under certain circumstances, you might still get directory name collisions, but with this method you've at least got a fighting chance.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
Plese some body help me out its very urgent,i am trying to update the dataset records into database but its not workinh fine ...
The code i have tried as follows for your reference
Da=new SqlDataAdapter("SELECT * FROM MailsInQueueTest",sqlcon);
SqlCommandBuilder builder = new SqlCommandBuilder(Da);
Da.FillSchema(MailDataset,SchemaType.Mapped,"t1");
Da.Fill(MailDataset,"t1");
foreach(DataRow dr in MailDataset.Tables[0].Rows)
{
if((Convert.ToInt16(dr[0]))==1)
{
dr.Delete();
//dr[3]=1;
}
}
MailDataset.AcceptChanges();
builder.GetDeleteCommand();
Da.Update(MailDataset,"t1");
Thanks in Advance
Chandra Gupta
|
|
|
|
|
on completion of any change you could try something like the following:
DataSet = changedData = MailDataset.GetChanges();
if(changedData != null)
{
SqlDataAdapter.Update(changedData);
}
else
{
MessageBox.Show(" Error ...", "Error");
}
dotman1
|
|
|
|
|
Apologies type in first line of code, correction.
DataSet changedData = MailDataset.GetChanges();
dotman1
|
|
|
|
|
public string TabloOlarakGuncelle(DataTable tablom)
{
using (SqlConnection connection = new SqlConnection("path"))
{
try
{
SqlCommand cmd = (SqlCommand)connection.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM Products";
SqlDataAdapter da = new SqlDataAdapter(cmd);
SqlCommandBuilder bldr = new SqlCommandBuilder(da);
//da.Fill(Dset, "Products");
da.Update(tablom);
return " Successfully: Güncelle işlemi tamamlanmıştır";
}
catch (Exception exp)
{
return "Error: Hata:aşağıdaki mesajı sistem yöneticisine bildiriniz \n" + exp.Message.ToString();
}
}
}
www.serkannet.com
|
|
|
|
|
Hi All,
I have richText control (my first time using this control ) and i have on it text that contain 10 word.
I need to paint in red color only 4 word of the text.
How can i do it ?
Thanks for any help.
|
|
|
|
|
|
|
download one of the file in my local folder, it downloaded perfectly. And once again I download the same file in the same folder, an error occurs.
I want to check the folder before i download the file. If the file is alredy in the folder , then it won't download in the folder.
Can you give the code for above Scenerio?
|
|
|
|
|
File.Exists, perhaps ? I would have thought the save file dialog would tell you if the file exists
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 )
|
|
|
|
|
jayarajmrj wrote: an error occurs
What error?
|
|
|
|
|
if (!File.Exists(...))<br />
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all
I am making a second form to help the user enter info that will go into a sql query
I have seen many examples to pass info TO a new form but i haven't really seen anything about how to pass the info back. I am currently using a public string hold the info in form1 but it seems to me that there must be a better way to pass the info back something more like a return or something like that
My other question is that is there anyway i can triger an event when form2 closes?
|
|
|
|
|
A delegate is the best way to pass data back. It's also an event, so it's the way to tell form1 that form2 has closed, assuming it's modeless.
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 )
|
|
|
|
|
could you give me a simple example
|
|
|
|
|
Hi
I am trying to get the comm port 1 working by using the .net 1.0 framework now I can do it with .net 2.0 with System.IO.Port but it seems that this is missing in .net 1.0.
Thanks
Samuel
|
|
|
|
|
|
Hi All,
I like to do some Excel File operation in my C# windows application.
but i cant find this Microsoft Excel 11.0 Object Library in Add Reference ---> com tab
where can i find this.....?
plz help me out
With Regards
Amjath
|
|
|
|
|
There is a seperate download for interop with Office, that could be what you need. The COM objects yuo need are also not installed unless the right version of Office is installed. Nothing comes with the IDE, least of all the express edition.
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 )
|
|
|
|
|
Amjath Rahman wrote: Microsoft Excel 11.0 Object Library
It is installed with MS Office 2003...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I created a static MFC DLL in VC++ 8.0 in .NET and created a method and put the export declaration in both header and source file as __declspec(dllexport) for that function.Then .NET i created a wrapper DLL in C# like
[DllImport("XCENSettingsManager.dll", EntryPoint = "CreatePatientFolders",
CallingConvention = CallingConvention.StdCall)]
public static extern int CreatePatientFolders(string pPatientID);
XCENSettingsManager.dll is the VC++ DLL.Now i created a windows application in C# and called the method i.e.CreatePatientFolders which is a method in XCENSettingsManager.dll.Now it is giving error saying "Could not able to load XCENSettingsManager.dll or the module is not found.Can any one help me.
|
|
|
|
|
hi!
is it possible to create my own report writer? wherein the end-user of the application will be the one who will customize the report. if it is how could it be done?
any suggestions will be greatly appreciated!
|
|
|
|