|
All you have to do is either check the DriveType of each of your DriveInfo object, or check the drive letter to see if its lower than C. If it doesn't meet the test you want, do add it to your list control.
|
|
|
|
|
Thank in advanced, i'll my best
................
|
|
|
|
|
If you don't want to work with a floppy drive, you can ignore A and B if it finds them. Or just put the code in a try catch, each time you check the properties.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Yes i already use Try Catch, but i can't bound it to combobox, the error response "Drive not ready".
How can i ignore Drive "A" or "B"?
Socheat
................
|
|
|
|
|
By removing them from your list ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
How can i remove?
................
|
|
|
|
|
By ignoring those letters when you iterate through the drives. You would have to have an intermediate step and not data bind your drop list to the drives collection, but that's basically it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I currently using VB.NET 2005, i want to connect to database on server with Ms Access.
Provider=Microsoft.Jet.OleDb.4.0; data source=//servername/d/database.mdb"
servername=socheat
after that i get error like that "Can not find instaled ISAM"
plese help me
................
|
|
|
|
|
Socheat.Net wrote: data source=//servername/d/database.mdb"
The correct format for a UNC path is \\servername\sharename\path\database.mdb
This, of course, depends on the server actually exposing a fileshare and you having Read and Write permissions to the share AND folder the MDB file is in.
|
|
|
|
|
Can u give me one example?
What about i get an error "Could not find installable ISAM"?
Socheat
................
|
|
|
|
|
Did you fix your path format and you still get the error ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
If possible give me one example?
Thanks
-- modified at 22:57 Thursday 17th May, 2007
................
|
|
|
|
|
I did in my first reply! All you had to do was change the Data Source clause to use the correct slashes. YOU have to provide the correct names for serverName, shareName, ...
|
|
|
|
|
LOL - you gotta love it. At least you were not mean enough to post an 'example' of a file on your network and wait to see what he said when it didn't work....
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I am wondering what the next post is going to be though. The database might not have anything in it. You know, like tables!
|
|
|
|
|
heloo guys.. u really doing agreat job ..any way i have created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string :
public void AddSv(Line l , ref string str)
{
if(drawwhat==1)// as one means lines
str +="1"+"\n"+l.First.X.ToString()+"\n"+
l.First.Y.ToString()+"\n"+
l.Second.X.ToString()+"\n"+
l.Second.Y.ToString()+"\n"+
l.Pen.Color.R.ToString()+"\n"+
l.Pen.Color.G.ToString()+"\n"+
l.Pen.Color.B.ToString()+"\n"+
l.Pen.Width.ToString()+"\n\n";
after i draw the line i click on save to send the informations to the text :
private void button1_Click(object sender, System.EventArgs e)
{
//save
System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
StreamWriter streamWriter=new StreamWriter(fs);
streamWriter.WriteLine(LineSv);
streamWriter.Flush();
streamWriter.Close();
fs.Close();
}as u can see i dealing vs 2003 .
Regards;;)
|
|
|
|
|
you need to read the string, then you need to parse it. It would make more sense to put commas between data items, so each shape is a line of text. They read the file as a string[] and call string.Split on each line to turn 1,2,34,5, into an array of strings, which you can then turn into numbers with int.TryParse. You can read the first number and use it to decide which function to send the array to, so that it can be parsed and objects added back to your array.
It would make more sense for the Line,Square,Triangle,Circle,whatever classes to offer a method that returns the string, so you can just iterate over your collection of base objects and call it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I may have hit myself in the head, but didn't we have an XmlSerializer class laying around somewhere?
|
|
|
|
|
do u mean like that :
if(openFileDialog1.ShowDialog()==DialogResult.OK)
{
StreamReader streamReader=new
StreamReader(openFileDialog1.FileName);
string m=streamReader.ReadToEnd();
string []x= m.Split();
MessageBox.Show(m);
streamReader.Close();
}
but this displays all the data in the file even after putting commas between data like 1 23 38 0 0 0 1 ,2....
iam lost !
|
|
|
|
|
I think I've suggested several times now that you abandon this project, it is obviously beyond you.
What else did you expect it to do ? You've done one part of what I said, although not quite how I said it, and shown the strings on the screen, what else could happen without more code to do it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 are right mr Graus ..i just wanna to thank u specially for ur effort with me ..god bless u my brother ; its the last time to ask about this project ..i swear .
cheers;);
|
|
|
|
|
Well, don't give up entirely. Just work through some other stuff so you're better able to understand the advice you're being given. I'm still trying to help, not to shoot you down in flames.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
I have 2 tables linked but I cannot seem to get any data to populate the subreport
I am at a loss. Is it possible to have 2 setdatasource statements.
I have a sub report which populates fine, just passing params
then the main text which pulls from a sql db which is fine and another
subreport which the headers shows up okay (I pass params to get the header text, but the data which is from another sql db does not show up. it must be something in the below snippet I am doing incorrectly. I am using dataadapters.
Dim crLtr_New As New BlueChoiceSolutionsLetterandReport.ltr_Ineligible_with_RACI
For i = 0 To 0 'Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows.Count - 1
'following line added 5-8-07 mgm testing
crLtr_New = New BlueChoiceSolutionsLetterandReport.ltr_Ineligible_with_RACI
Soln_id = Trim(Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("soln_id"))
'added 5-9-2007 mgm
Me.DsAll1.Tables("dbo_usp_WS_RACI_Summary_Reports").Clear()
'if Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("soln_id") <> sOldSolnId Then
' Me.DsAll1.Tables("dbo_get_summary").Clear()
' Me.sdaget_summary.SelectCommand.Parameters("@soln_id").Value = Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("soln_id")
'Me.sdaget_summary.Fill(Me.DsAll1.Tables("dbo_get_summary"))
Try
Me.ssdausp_WS_RACI_Summary_Reports.SelectCommand.Parameters("@Soln_id").Value = Soln_id
Me.ssdausp_WS_RACI_Summary_Reports.Fill(Me.DsAll1.Tables("dbo_usp_WS_RACI_Summary_Reports"))
Me.sscusp_WS_RACI_Summary_Reports.Parameters("@Soln_id").Value = Soln_id
Catch ex As Exception
MsgBox(ex)
Exit Sub
End Try
'End If
With lblStat
.Text = "Setting Report Parameters"
.BackColor = Color.White
.Refresh()
End With
sOldSolnId = Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("soln_id")
crLtr_New.Database.Tables("dbo_usp_WS_RACI_Summary_Reports").SetDataSource(Me.DsAll1.Tables("dbo_usp_WS_RACI_Summary_Reports"))
'crLtr_New.SetParameterValue("prmSoln_Id", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("soln_id"))
'crLtr_New.SetParameterValue("prmRpt_Dt", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("ltr_dt"))
crLtr_New.SetParameterValue("prmRACI", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("group_raci"))
crLtr_New.SetParameterValue("prmAddr_Ln1", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("addr_ln_1"))
crLtr_New.SetParameterValue("prmAddr_Ln2", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("addr_ln_2"))
crLtr_New.SetParameterValue("prmAddr_Ln3", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("addr_ln_3"))
crLtr_New.SetParameterValue("prmAddr_Ln4", "") 'Temp dummy var
crLtr_New.SetParameterValue("prmLtr_DtW", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("ltr_dt"))
crLtr_New.SetParameterValue("prmProvId", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("prov_id"))
crLtr_New.SetParameterValue("prmDear", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("dear_txt"))
crLtr_New.SetParameterValue("prmPhone", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("phone_txt"))
'crLtr_New.SetParameterValue("prmEff_Dt", Me.DsAll1.Tables("dbo_get_ineligible_with_sum").Rows(i)("ltr_dt"))
crLtr_New.SetParameterValue("prmModeled", Me.DsAll1.Tables("dbo_usp_WS_RACI_Summary_Reports").Rows(i)("Modeled"))
'*************************Sub report Graph Code
Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Clear()
' Me.sdausp_det_rpt_get_report_amt_util_soln_id.Fill(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id"))
' check for rowcount and check to make sure data is being passed to somewhere
Try
Me.sdausp_det_rpt_get_report_amt_util_soln_id.SelectCommand.Parameters("@ntwk_id").Value = Network_id
Me.sdausp_det_rpt_get_report_amt_util_soln_id.SelectCommand.Parameters("@Soln_id").Value = Soln_id
Me.sdausp_det_rpt_get_report_amt_util_soln_id.Fill(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id"))
Catch ex As Exception
MsgBox(ex)
Exit Sub
End Try
'parameters for sub report Graphs
'************************************************************
'crLtr_New.OpenSubreport("ltr_ineligible_raci_3_text.rpt")
'crLtr_New.Subreports(1).SetDataSource(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id"))
crLtr_New.Database.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").SetDataSource(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id"))
For j = 0 To Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows.Count - 1
sRACIdec = "The RACI for " & Trim(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("working_specialty_desc").ToString)
sRACIdec = sRACIdec & " in " & Trim(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("tccwin_area_desc").ToString)
sRACIdec = sRACIdec & " for Solutions ID " & Trim(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("soln_id").ToString)
sRACIdec = sRACIdec & " is " & Trim(Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("raci").ToString)
crLtr_New.SetParameterValue("prmsoln_id2", Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("soln_id"))
crLtr_New.SetParameterValue("prmworking_spec2", Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("working_specialty_desc"))
crLtr_New.SetParameterValue("prm_area_desc2", Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("tccwin_area_desc"))
crLtr_New.SetParameterValue("prmraci2", Me.DsAll1.Tables("dbo_usp_det_rpt_get_report_amt_util_soln_id").Rows(j)("raci"))
crLtr_New.SetParameterValue("prmdesc", sRACIdec)
Next j
-Mecca
|
|
|
|
|
In a filewatcher I want to test to see if a file is complete. I tried this:
File.Open("c:\test.txt", FileMode.Open, FileAccess.Read, FileShare.None)
I don't get an exception when the file is open with Notepad.
How can I detect the file is opened by another program?
Thanks
|
|
|
|
|
Notepad doesn't lock a file open. It opens a file for Shared access, reads the file and closes it immediately.
When it goes to save the file, it opens the file for DenyShareAll, writes it out, then closes it.
dBrong wrote: How can I detect the file is opened by another program?
That depends on the behavior other program, as you've already found out.
dBrong wrote: How can I detect the file is opened by another program?
Reliably, for any application?? You can't.
|
|
|
|