|
You don't understand your own code?
You have a @ delimited string which you have split into two strings, but you have forgitten to put the @ delimiter before the second string.
Example:
string s = @"A ""string"" with some ""quotes"".";
Split into two strings:
string s = @"A ""string"" with " + @"some ""quotes"".";
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
This should work:
To many qoutes according to me....
string ConnectionString = String.Concat(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=", textBox1.Text ,";Extended Properties=Excel 8.0;HDR=YES;");
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
You can build your string like this:
string ConnectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;""", textBox1.Text)
By the way, give your controls more meaningful names.
|
|
|
|
|
Use it this way. @ comes before any string segment
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ textBox1.Text + @";Extended Properties=""Excel 8.0;HDR=YES;""";
|
|
|
|
|
Just try this:
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"+ textBox1.Text +"';Extended Properties=""Excel 8.0;HDR=YES;""";
Be a good professional who shares programming secrets with others.
|
|
|
|
|
i want to make the fix sized text in text box(e.g 10 characters).
it means i made a textbox and also want that user can't enter the characters upto 10 characters..
user is bound at 10 character.
--------------------------------------------------------------------------------
maifs
maifs
|
|
|
|
|
Set MaxLength property of textbox.
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
|
TextBox1.MaxLength =10;
hghghgh
|
|
|
|
|
How do I write a console application that imoplements a recursive function
that calculates the approximate infinite sum(of time) of zeno's paradox depending on the number of attempts of Archelles to overtake the tortoise.
Thanks
|
|
|
|
|
What is it that you have problems with?
Creating a console application project?
Implementing a recursive function?
Understanding the homework assignment?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Its all about implementing a recursive function.
|
|
|
|
|
You're going to need a very large stack to calculate an infinite sum. I suggest you use a Turing machine; it can do anything!
|
|
|
|
|
is java and c# encryption supports each other
i want to send an encrypted xml by c# to java . i use rsacyptographyserviceprovider to encrpyt. how can i decrypt this in java. can you give me any clue or an article which i can refer.
|
|
|
|
|
Hi,
When i try to send mail from c# windows application all mails are blocked in Queue (C:\Inetpub\mailroot\Queue). How can i unblock the mails send from the windows application.
Why it is blocked?
Thankyou,
yesu
|
|
|
|
|
ypki wrote: Why it is blocked?
Your SMTP server won't be running. Check in the IIS manager to see SMTP service is running or not.
|
|
|
|
|
I am trying to create a relation between two datatables.Here is the code i am using
SqlConnection conDatabase = new SqlConnection(databaseConnectionString);
SqlCommand cmdDatabase = new SqlCommand("SELECT * FROM StudentModule",conDatabase);
SqlDataAdapter daDatabase = new SqlDataAdapter(cmdDatabase);
//Get Columns for DataRelation
DataColumn[] databaseColumns = new DataColumn[dsImport.Tables[0].Columns.Count];
for (int i = 0; i < databaseColumns.Length;i++)
{
databaseColumns[i] = dsImport.Tables[0].Columns[i];
}
OleDbConnection conSpread = new OleDbConnection(spreadSheetConnectionString);
OleDbCommand cmdSpread = new OleDbCommand("SELECT * FROM[Sheet1$]",conSpread);
OleDbDataAdapter daSpread = new OleDbDataAdapter(cmdSpread);
//Get Columns for DataRelation
DataColumn[] spreadColumns = new DataColumn[dsImport.Tables[1].Columns.Count];
for (int i = 0; i < spreadColumns.Length;i++)
{
spreadColumns[i] = dsImport.Tables[1].Columns[i];
}
//Create DataRelation
DataRelation r = new DataRelation(string.Empty,databaseColumns, spreadColumns,false);
dsImport.Relations.Add(r);
The problem is that when i debug and step into the code the debugger does not go into the for loops,and therefore does not load the columns.What could be causing this plz help?
|
|
|
|
|
Looks you missed the statement to fill the DataSet.
daDatabase.Fill(dsImport)
Regards,
Syed Mehroz Alam
|
|
|
|
|
Thank you very much.i did not see that
|
|
|
|
|
i filled the dataset but it is still doing the same thing.
Anything else i'm missing???
|
|
|
|
|
It seems that you want to fill the same dataset in both the queries. Are you sure you are using the correct overload of Fill()[^] method.?
|
|
|
|
|
yes I want to Fill thesame dataset so that the comparison can be done and then create a third datatable
|
|
|
|
|
I am still foggy on this concept. Let me explain what I grasp (or think I do) so far. I will use this code as reference:
class TestClass
{
private int privVar = 5;
public int PubVar = 3;
}
(I know I am missing some code, but Im trying to keep it simple)
A private instance variable can only be modified within the class it was declared in. Or, within the method it was declared in.
A Public instance var has the same rules but also can be accessed by using it this way:
TestClass testClass = new TestClass();
int x = testClass.PubVar();
All of the books and articles I have read say that using public instance variables can be dangerous. Its not that I dont believe them, I just dont understand where the harm lies. In my current view, it seems like a person would have to instantiate your class by accident somehow, then use the testClass.PubVar(); (or w/e they named it) without know it is yours and not theirs?
Maybe because I am still learning C# and dont know of other ways that you can harm your variable? The reason why I bring this up now is because I am taking on the Get() and Set() methods, and the logic behind them is really confusing me.
I hope I am being descriptive enough of my problem, I was hoping to avoid a huge wall of text but maintain as much clarity of my question as possible.
Thanks
|
|
|
|