|
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
|
|
|
|
|
It can be "dangerous" to expose your class variables to the public, because your class has no idea that the outside world has changed the value.
If your class needs to know that the value has changed, then it's best to wrap it in a property, so you can add extra logic in the set method to deal with the new value.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I would suggest you look up encapsulation and/or information hiding to read about this. I'd add a link to wikipedia, but I didn't think the article there was too helpful - Google should suffice though.
Hope this helps,
Chris
|
|
|
|
|
can someone help me, need it badly.
|
|
|
|
|
I have an application that contains a dataset with a few datatables. I have a few .csv files that I'd like to load into the datatables. Can that be done? If so, how?
Thanks!
|
|
|
|
|
Open the .csv file with a StreamReader, read each line, then do a String.Split on the
commas (do this for each line).
Then insert the rows into the database.
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|