|
hello,
I deveopped a web application with Visual Studio 2008.My database is elaborated with Navicat 8 for Mysql.
I want to connect to my db.I have this connection string;
string ConnectionString= "Driver={Navicat 8 for MySQL};"
+ "Server=localhost:3306;" + "Database="+informations+";" + " UID=root;" + "PASSWORD=root";
when I run,it show me this error:
"informations doesn't exist in the current context",informations is my database's name.
I think that I miss to add connection from my project(Tools--->connect to database"),this doesn't show any thing to help me because i couldn't add my database.
Someone to help me is so grantful
ty
|
|
|
|
|
What it is saying is the the variable "informations" does not exist in the current method as a local variable, or as a parameter,and that it does not exist at the class level either.
Have you recently moved the code from one method to another?
Or should "informations" be inside the string:
string ConnectionString= "Driver={Navicat 8 for MySQL};"
+ "Server=localhost:3306;" + "Database=informations;" + " UID=root;" + "PASSWORD=root";
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Please don't attempt to bump your post. It's disrespectful.
Original post here[^].
|
|
|
|
|
you are getting error "information doesn't esist in the current context" because you've not created any location holder(variable) of information. as you mention "information" is your database Name then OriginalGriff pointed you a perfect answer you should put it inside as "Database =information"
for more details you can go there[^] to learn basic of creating connection
|
|
|
|
|
Hi,
I have a huge set of text files each being 100 kb to 1 mb. My Application reads the files (only 1 at a time) and process the string in it.
My problem is the total size of files are are very large. Is there any way, we can store the files in some format which takes lesser disk space. eg. byte array, or something...
Currently, I have zipped the files and reading the zipped file from my application. Is there any better way to do so.
Thanks,
|
|
|
|
|
Hi Anurag,
You should consider using an MSSQL Compact Database. This is a database that is stored in a single file.
A database will generally store very large amounts of small data extremely efficiently - as well as providing a very rapid way to query that data.
Certainly worth considering - although without more information about what the data is, it's tricky to know!
If a database isn't suitable, then you will get a size decrease and performance increase if you use a binary file format rather than a text file format.
Also note that it can be rather inefficient space-wise to have lots and lots of small files, so again finding some way to aggregate the data into a larger file that can be rapidly accessed may be good.
|
|
|
|
|
Anurag Gandhi wrote: Is there any better way to do so.
No.
Unless you have very particular definitions for better and process.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
By "Better", by default I mean to say "Better by Performance (In terms of disk space, Time consumed and CPU utilization)".
Every time we may not explain each of our words.
|
|
|
|
|
Anurag Gandhi wrote: Better by Performance (In terms of disk space, Time consumed and CPU utilization)
so if I can do it twice as fast at the expense of twice the disk space, is it better or worse?
If you refuse to give sufficient information, don't bother asking in the first place.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Well, I don't wish to argue on this.
Apology, i could not convey my issue properly.
As already mentioned, my issue is disk space.
I can compensate on time consumed, this time, to some extent.
As someone suggested, I liked the database approach as it should take lesser space as well as it will be faster.
Thanks Anyways.
|
|
|
|
|
When disk space is your primary concern:
- I don't see how a database would be more compact than plain text files;
- compression is what you want, ZIP is very good at compressing text (however it takes lots of cycles to decompress).
If you find anything significantly better than ZIP I will be very interested!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Ok, for the time being I will keep the zip aproach only.
I will let you know, in case, i will get better approach.
Thanks for all your help Luc.
|
|
|
|
|
I have to agree with Luc.
ZIP is probably the smallest you will practically get it (or RAR - I won't argue).
A database will quite likely increase the space taken up, as it stores all sorts of extra information over and above your text (table definitions, row ids, etc.).
However, a database may improve the raw disk space usage compared to a lot of separate files, depending on your HDD format. In some formats, a file must occupy complete clusters, so a lot of files mean a lot of partially empty clusters. This is not the case with database or zip.
MySQL does support a COMPRESS function that shrinks a text string, I don't think MsSql does (I could be wrong). However, it required a ZIP library to be loaded so it won't save you anything over using ZIP directly!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
zipping seems to be a good idea.
without knowing anything about the content/structure of your textfiles, its not possible to say more.
I cannot remember: What did I before google?
|
|
|
|
|
Hi,
Thanks for your response.
Each file is a list of string which needs to be parsed by the application.
Those string will essentially contain ASCII chars only. UTF-8 only.
|
|
|
|
|
strings -> zip -> optimal.
if you provide sample data, maybe we can found something else.
I cannot remember: What did I before google?
|
|
|
|
|
As mentioned before, if you can extract the data to a database, that would be the best, most flexible solution.
If the string data is predominately numeric you could convert the numeric data to a numeric datatype and then store the file as a binary file. A binary representation of a number is typically a chunk smaller than the string representation of the same number.
"You get that on the big jobs."
|
|
|
|
|
Hi,
I am creating Download manager application which requires pause and resuem capability. I am working on C# application. Can anyone suggest me way(s) for requming cancled or pause downloading file.
Happy Programming
|
|
|
|
|
Going through this[^] article might help you out.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Hi Pranit this Link[^] might help you.
|
|
|
|
|
Hello,
I VC++/MFC developer and new to C#. I wanted to know how I detect portable device attached to my PC. And how to distinguish them like pen drive, iPhone, iPod etc.
Thanks in advance.
|
|
|
|
|
Today I accidentally stumbled upon this page in the MSDN Documentation:
ContextStaticAttribute[^]
What the hell is a context? How do I create one or change the current context, etc...?!?
Somewhere on the intertube I found it seems to be different for each query in an ASP.NET app, how about remoting / WCF? I guess it is but it's fuzzy, and not well defined in my mind....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
In .NET a context appears to me to be a little schizophrenic. They pop up all over the place and seem to represent something slightly different each time. I guess it depends on the context.
I'm not sure if it represents what you have found but this[^] page, also from MSDN, has the clearest explanation I have seen.
Hope it helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Good find hey, thanks!
BTW, I liked your pun!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi guys,
I am able to access my own outlook calendar but i wanted to know how could I access the shared calendar via C#.
The shared Calendar resides in the Outlook Public Folders. I couldn't find any examples
Could you please help me.
Thanks
|
|
|
|