|
Yah i have done this in my code.yah the scenario is really amazing.
Suppose there are to system A & B. Then i can access that folder from A but not from B.
This is my out of mind. Why its happening ?????
Devesh Mishra
|
|
|
|
|
With so little information we're unable to help properly.
Are the machines part of a domain? Are the same users trying to access the share? Are you able to access the share from windows explorer? When you do so for the first time after rebooting the computer, does it prompt you for user name and password before allowing you access to the share?
Questions over questions...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
yah all the system are from the same domain. There are two diff users, trying to access the share folder on two diff system. it doesnt prompt for the username and password, after rebooting the system.
Hey i know the whole scenario is really embarrassing... its totally my out of mind..
Thanks
Devesh Mishra
|
|
|
|
|
hi!
How can we use Treeview inside a DataGrid. is any wasy to use the treeview in datagrid if yes plz help me as soon as possible.
|
|
|
|
|
You can put any control inside a datagrid control.To do this follow this steps
1) In the column collection add a template column.
2) Right click and select edit template
3) In the Item template section drag and drop which ever control you like to have.
|
|
|
|
|
Hello,
can someone explain to me what i've done here?
What role does the delegate play? And is the
that correct way to go about setting up an event in
a class?
<br />
void objRecoContext_Recognition(int StreamNumber, object StreamPosition,SpeechRecognitionType RecognitionType, ISpeechRecoResult Result)<br />
{ <br />
this.phrase_recognised(RecognitionType, Result);<br />
}<br />
<br />
public delegate void phrase(SpeechRecognitionType RecognitionType,ISpeechRecoResult Result);<br />
<br />
public event phrase phrase_recognised;<br />
Thanks..
|
|
|
|
|
perhaps i should mention that the 'objRecoContext' object is a 'SpeechLib.SpSharedRecoContext'.
I'm trying to follow one of the articles from this site to make an easy to use speech-command recogniser.
|
|
|
|
|
how to get the values of each row from datagridview and save it in a flat file.DGV is having 3 columns.how can it be done with help of supporting class.
platform-dot Net and C#
|
|
|
|
|
I'm not sure how you plan to get these values into your flat database. I might be able to help more if I knew the type of database. Either way, here's how you can get the values out of the datagrid
private void reader()
{
foreach (GridViewRow r in GridView1.Rows)
{
//The index just represents which column you want to retrieve the values from
string value = r.Cells[0].Text; //column 1
string value2 = r.Cells[1].Text; //column 2
string value3 = r.Cells[2].Text; //column 3
//Add code here insert the values into your flat db
}
}
Lester
http://www.lestersconyers.com
|
|
|
|
|
If the flat file is more specifically ASCII text flat file, then it is better if the file is created from within the C# app.
You can use StreamWriter class to create your flat file and prepare a string by appending values from the Grid View cells and finally write this string to the file.
|
|
|
|
|
Hi All,
I have an excel file in this format, which I am trying to read using c#
04/05/2006 46 47
25 26 27
15 vgc 57
I am not able to read the values of row[1][0] and row[2][0], because in this column, the datatype of value in first row is date (04/05/2006).
In the same way, I am not able to read the row[2][1], because in this column, the datatype of value in first row is a numeric.
So, according to my perception, you need to have same datatype values in any particular column to read it in C#.
I am looking for any option to read these type of excel files with values of different datatypes in a particular column.
Any input will be highly appreciated.
FYI, This is the code snippet, I am using to read this excel file.
// Create connection string variable. Modify the "Data Source" parameter as appropriate for your environment.
String filePath = "D:\\ProjectInfo\\HU Mail\\test.xls";
String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + filePath + "; Extended Properties=\"Excel 8.0;HDR=NO;\"";
// Create connection object by using the preceding connection string.
OleDbConnection objConn = new OleDbConnection(sConnectionString);
// Open connection with the database.
objConn.Open();
DataTable dt = null;
// Get the data table containg the schema guid.
dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
String[] strSheetName = new String[dt.Rows.Count];
int i = 0;
// Add the sheet name to the string array.
foreach (DataRow row in dt.Rows)
{
strSheetName[i] = row["TABLE_NAME"].ToString();
i++;
}
string strComand = "select * from [" + strSheetName[2] + "]";
OleDbCommand objCmdSelect = new OleDbCommand(strComand, objConn);
// Create new OleDbDataAdapter that is used to build a DataSet based on the preceding SQL SELECT statement.
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
// Pass the Select command to the adapter.
objAdapter1.SelectCommand = objCmdSelect;
// Create new DataSet to hold information from the worksheet.
DataSet dsDeal = new DataSet();
// Fill the DataSet with the information from the worksheet.
objAdapter1.Fill(dsDeal, "LMPPrices");
for (int k = 0; k < dsDeal.Tables[0].Rows.Count; k++)
{
for (int j = 0; j < dsDeal.Tables[0].Columns.Count; j++)
{
Console.Write(dsDeal.Tables[0].Rows[k][j].ToString() + " -> ");
}
Console.WriteLine();
}
Console.ReadLine();
Best Regards,
|
|
|
|
|
This is kind of a hack-ish workaround, but how about reading every cell as a string and then using int.TryParse and DateTime.TryParse to determine what type each particular cell is?
|
|
|
|
|
|
|
Hi a have a problem whit the cancel lenghty opetations I must do it using the threads or asynchrone calls,witout bacground worker component in C# please help me to do it
Ira84
|
|
|
|
|
|
First n foremost, try to write ur query in precise manner, so that person can get exact idea related to ur problem n base on it, u can get quick/better answer.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Hi,
I'm trying to parse a database query entered into a TextBox in our webform using C#. Could someone tell me how to frame a reg expression, to extract all words between '"+, i.e.
if query is:
SELECT COL1, COL2 FROM TABLE1 WHERE COL1 = '" + str1 + "' AND COL2 = '" + str2 + "'
In the above expression, I want the values str1 and str2 in an arraylist.
Is this possible using regular expression, and is using regular expression the fastest (performance wise) way to achieve this?
Regards,
Blumen
|
|
|
|
|
\"\s*\+\s*([\w|\d|_]+)\s*\+\s*\" Will look for a quote, followed by some or no whitespace, then a plus, some more optional whitespace, then a group of letters, digits or underscores followed by some optional whitespace, a plus, optional whitespace and the closing quote.
Performance wise you will take a slight hit, if the regex isn't changing then mark it with RegexOptions.Compiled to compile it to IL. The benefit is that it will be easier to adapt if there (probably) is a bug or flaw in the regular expression or requirements change.
|
|
|
|
|
Hi,
Thank you for the response, I tried it but its not returning all instances of the words, and also returned word contains quotes and plus sign.
I'm using this code:
string pattern = @"""\s*\+\s*([\w|\d|_]+)\s*\+\s*""";
Regex re = new Regex(pattern);
MatchCollection matches = re.Matches(s);
string[] words = new string[matches.Count];
for (int i=0; i
|
|
|
|
|
blumenhause wrote: I tried it but its not returning all instances of the words
Can you provide an example which it's not matching?
blumenhause wrote: and also returned word contains quotes and plus sign.
That's probably because \w includes these or something, try changing the bit between the [] to:
[A-z|0-9|_] Which will be just any letter, number or underscore.
|
|
|
|
|
I am using the code i provided in my second interaction.
Ed.Poore wrote: Can you provide an example which it's not matching?
blumenhause wrote:
select col1, col2, col3 from table1 where col1 = '" + str1 + "' and col3 = '" + str2 + "'
Regards,
Blumen
|
|
|
|
|
Regex regex = new Regex(@"\""\s*\+\s*(?<varname>[A-z|0-9|_]+)\s*\+\s*\""", RegexOptions.Compiled);
string input = @"select col1, col2, col3 from table1 where col1 = '"" + str1 + ""' and col3 = '"" + str2 + ""'";
foreach (Match match in regex.Matches(input))
{
Console.WriteLine(match.Groups["varname"]);
} The above code works fine, notice that I've introduced a name for the group (?<varname>...) which makes the group easier to reference later on in the code. That I think it what you were not doing properly before.
|
|
|
|
|
I'm using Windows 2000 Advanced Server SP4 and I have tried the code snippet below:
WindowsIdentity winid = WindowsIdentity.GetCurrent();
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal prin = (WindowsPrincipal)Thread.CurrentPrincipal;
MessageBox.Show(prin.IsInRole(Environment.MachineName + @"\" + "test").ToString());
My computer is not a domain controller and I dont have active directory installed. I created a group on my local machine named 'test' and added administrator to that group as a member and logged on to windows with administrator account. So the code above returns True and displays it. This is fine but when I remove administator from the group 'test' the code still shows True. This persists until I delete the group itself. Then the code displays 'False'. What do you think is the cause of this behavior?
I also have a problem retrieving a specific user's groups. I thought the IdentityReferenceCollection class would be useful and I used the code below:
IdentityReferenceCollection irc = winid.Groups;
foreach (IdentityReference var in irc)
{
MessageBox.Show(var.Value);
}
But this only displays some numbers that might have meaning to windows itself. but not a visual appearance of the groups on my local machine. such as a string conataining the groups' names. Any idea?
|
|
|
|
|