|
|
munishk wrote: why it is recommended to use connection statements within using?
It isn't; I don't do it that way anyway. I dislike code that keeps instantiating and disposing Connections and Commands over and over again for no good reason. I prefer to instantiate each once and hold onto it for the duration -- opening and closing the Connection as needed, setting the CommandText, etc. But that's because of the type of systems I write; your systems may not benefit from it.
Additionally, I wrap Connections and Commands in my own classes which implement IDisposable, so when it makes sense to (mostly console utilities) I instantiate my class with a using statement:
using
(
PIEBALD.Data.IDatabase db
=
new PIEBLAD.Data.SqlServerDatabase
(
...
)
)
{
...
}
|
|
|
|
|
As per the the title, I am taking over a project from QIOS DevSuite which included many useful free controls such as a Winforms Ribbon Control etc..
I want to keep this control free to the public, but I can't do it all on my own!! The reason for my post is, I am trying to build a community of volunteers to help with future development (like how phpbb is developed now) and support.
Currently QIOS have taken the control off line, but they have so far provided me with the forum and previous data etc.. So, if this is of interest as a small hobby then please get in contact with me at www.forum.qdevsuite.com.
Here is a link to screen shot of the qdevsuite http://www.qdevsuite.com/home3.gif[^]
Thank you
Dan
(Mods please delete if I have broken any rules, Sorry!)
|
|
|
|
|
Santa's Little Helper wrote: (Mods please delete if I have broken any rules, Sorry!)
Whehe, yeah, just post blindly and let the mods clean up after you.
You should have posted in the collaboration-section, the menu is on the left side of your screen
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I know, but I wasn't too sure, and didn't want to offend anyone.
Thanks, I will try that section as you suggested.
|
|
|
|
|
Hi, I have MS Visual Studio 2010 and I program in C#. I need a good looking, prebuilt UIs for my entire application. If you know some resources I'll be glad if you tell me. Thanks.
|
|
|
|
|
Web, Windows Forms, WCF? Resources for each can easily be found by searching on google. You are probably not going to find prebuilt UIs, however, as each application will present its own set of challenges and customization. After all, if all the UI's were to be prebuilt and existing, then the underlying application is likely to have been built along side it and you would be able to purchase or download the complete application negating the necessity for you to write it in the first place....
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You're right but I'm too close to the end line of the project. Therefore I didn't have another choice cause of lack of time. Thanks, by the way
|
|
|
|
|
You haven't said what the application does, or what technology it is. This may seem minor to you, but it will affect the answers you get if you don't provide vital information.
|
|
|
|
|
The application itself is based on WinForms. I needed an alternative for buttons, message boxes and so on. Now, I, by myself, have found Telerik RadControls pretty useful, finally after too much googling
|
|
|
|
|
atoi_powered wrote: I, by myself,
That is because you asked for an entire UI, you should have asked for a control suite. Telerik is a good choice, there are quite a few others out there as you have no doubt found.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As CodeProject doesn't have a telepathic interface installed yet, you would have to find this out for yourself. The moral here, if you want useful help, ask a decent question.
|
|
|
|
|
I am looking for good example or articles where Database programming with all operations on multiple tables is depicted using Isolated Storage.
Please suggest some good articles.
|
|
|
|
|
|
SqlConnection conn = new SqlConnect(
"Integrated Security=SSPI;Data Source=DBSRV1;Initial Catalog=master");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_attach_db";
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128).Value = "MyDB";
cmd.Parameters.Add("@filename1", SqlDbType.NVarChar, 260).Value =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.mdf";
cmd.Parameters.Add("@filename2", SqlDbType.NVarChar, 260).VAlue =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.ldf";
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
This is OK but i need to get the DataBase Name and File Name from TextBox,i Tried but its not working any Help
|
|
|
|
|
pranee24 wrote: i Tried but its not working any Help
Without seeing some of your code we cannot begin guess what is not working.
|
|
|
|
|
pranee24 wrote: i Tried but its not working
Does not tell anyone what you tried or why you think it's not working.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
modified 12-Jul-12 14:39pm.
|
|
|
|
|
Why is your message type "General" rather than "Question"?
pranee24 wrote: i need to get the DataBase Name and File Name from TextBox
1. So you shouldn't be using string literals then, rather use string variables, load them from the textbox(es), and feed them to your SqlCommand parameters.
2. Are you sure you want the users to have the liberty to enter anything they like? When I need access to a small number of databases, I tend to offer a choice (say a ComboBox), and have basically a switch in my code.
pranee24 wrote: its not working
interesting.
|
|
|
|
|
try this:
string dbName = txtDbName.Text.Trim();
string fileName1 = txtFileName1.Text.Trim();
string fileName2 = txtFileName2.Text.Trim();
SqlConnection conn = new SqlConnect(
"Integrated Security=SSPI;Data Source=DBSRV1;Initial Catalog=master");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_attach_db";
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128).Value = dbName;
cmd.Parameters.Add("@filename1", SqlDbType.NVarChar, 260).Value = fileName1;
cmd.Parameters.Add("@filename2", SqlDbType.NVarChar, 260).Value = fileName2;
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
Note: Assuming user sending required/valid data from the above textboxes
|
|
|
|
|
Hello members,
I am developing Asp.net website application with framework 4.0 in Visual studio 2010. I would like to convert App_Code to single DLL which contains class files and dataset. Is it possible? Please give your suggestions
Thanks
modified 13-Jul-12 1:24am.
|
|
|
|
|
yes you can make DLL file of all the classes. this will help you to protect your code from others
hope dis link will help you
http://www.c-sharpcorner.com/uploadfile/mahesh/dll12222005064058am/dll.aspx
|
|
|
|
|
Just build the web app. That will already copy it into a single dll. You don't need to do anything special.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
hello
I whould like to convert the requete execute reader to liste:help me please.
this me requete:
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand("SELECT libelle_titre FROM titre", ConnectBase.getinstance().Connection());
List<int> liste= new List<int>();
affiche_titre = comm.ExecuteReader();
while (affiche_titre.Read())
{
liste.Add(Convert.ToInt32(affiche_titre["libelle_titre"].ToString()));
titre1.Text = liste[0]ToString();
titre2.Text = liste[1].ToString();
titre3.Text = liste[2].ToString();
thanks
|
|
|
|
|
Uh ... what's the question? You're already moving the results into a list.
|
|
|
|
|
my question hwo to execute my requete in the list and
any result in the texBox :
example:
..............
..................
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand("SELECT Title FROM titre", ConnectBase.getinstance().Connection());
rs = comm.ExecuteReader();
while (rs.Read())
string []tab = rs.ToString()
texBox1.Text= tab[0];
texBox2.Text= tab[1];
texBox3.Text= tab[2];
......
...
Thanks
|
|
|
|