|
This is not an error with simultaneous connections but rather with authentication.
There is no limit on the number of connections in SQL 2005 Express.
|
|
|
|
|
Make user accounts and associate with a login.
I think it supports multiple users if not the database is altered as Single User.
|
|
|
|
|
I'm not versed in SQL server management.
When I created database in VS it gave default connection string which I'm using:
Data Source=.\SQLEXPRESS;AttachDbFilename=C:\dbs\MyDatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
I've got SQL 2005 express and managment tools.
How to add those users and change connection string param?
Currently, single applicaion engages db file resulting in:
System.Data.SqlClient.SqlException in Void OnError(System.Data.SqlClient.SqlException, Boolean): Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\SYSTEM'.
Until application is closed or some period of time elapses, MyDatabase.mdf becomes engaged as you neither can not delete it nor open.
How to manage that multiple clients connections to single db?
Чесноков
|
|
|
|
|
It is an authentication issue. Why is your app trying to connect as SYSTEM user ? Are you trying to connect from a windows service ? Whatever the case may be, if you are using Windows Authentication, ensure that the user is trusted with SQL Server or use SQL Server authentication.
|
|
|
|
|
|
hai....help me plz....urgent
i create data table for treeview lik dis
with hospital name as treenodes|Dr names as subnodes .. Apolo|Dr.jhon
Image|Dr.Krish
Care|Dr.Ram
Apolo|Dr.sri
Image|Dr.prabhu
Care|Dr.san
i want treeview display lik dis....
-.Apolo
. .
. .
. .Dr.jhon
. .Dr.sri
.
-Image
. .
. .
. .Dr.prabhu
. .Dr.Krish
.
-Care
.
.
.Dr.Ram
.Dr.san
but in treeview it displaying lik dis..it opening in another treenodes with single name..
-.Apolo
. .
. .
. .Dr.jhon
.
.
-Image
. .
. .
. .Dr.prabhu
.
.
-Care
.
.
.Dr.Ram
-.Apolo
. .
. .
.
. .Dr.sri
.
-Image
. .
. .
.
. .Dr.Krish
.
-Care
.
.
.Dr.san
thanqu....
|
|
|
|
|
Its because you have to add your Doctor nodes as children of your hospital ones.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
It is because you are adding everything to the TreeView's Nodes collection. You have to take care of the hierarchy, TreeView cannot automatically do it for you.
TreeNode hostpitalNode;
hostpitalNode = treeView1.Nodes.Add("Apolo");
hostpitalNode.Nodes.Add("Dr. Krish");
And while posting, follow the guidelines, it is 'urgent' for you, not for others.
|
|
|
|
|
hai...sory sory...im new for thees messages ......i dono how 2 write...forgive me yar...
any ways thanqu for ur reply....
|
|
|
|
|
hai...Shameel.....yah i tried ..but again it displaying in hierarchy manner...i dont want Dr's name displaying in another same hospital name....
(actuly i given in Data table ,,in same hospital name with 2 Dr's names....but...its displaying in 2 different treenodes...i want 2 show in single hospital name with 2 Dr's names)
Apolo|Dr.jhon
Image|Dr.Krish
Care |Dr.Ram
Apolo|Dr.sri
Image|Dr.prabhu
Care |Dr.san
public void TreeviewBind()
{
query= "Select * from Clinic_tbl";
da = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
da.Fill(ds, "Clinic");
foreach (DataRow row in ds.Tables[0].Rows)
{
rootNode = treeView1.Nodes.Add(row[0].ToString());
rootNode.Nodes.Add(row[1].ToString());
}
}
i hope u understod my lang..im new for Dotnet...this is my 1st project.........thanqu
|
|
|
|
|
Your code does what you have asked it to do. It is your headache to find out if the hospital is already added to the TreeView and add your doctor there.
Hint: Use treeView1.Nodes.Find() to find out if the hospital is already added.
Your first problem is that your table is not normalized.
|
|
|
|
|
Marking the post as urgent and requesting urgent help is very rude around here.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hai...sory sory...im new for thees messages ......i dono how 2 write...forgive me yar...
|
|
|
|
|
If you are new here then you should have read this[^] correct?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi sir,
i am work in c#. my problem user defined color change one form to another form
then help me,
pls reply me
|
|
|
|
|
Not sure what you are asking. Do you want to let user change the color of your forms?
You can use a ColorDialog and then set the choosen color as the Backcolor of the form using BackColor property.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hello
I have a question or two and maybe someone here can help, i thank you in advance , i am kinda new with C# language
I need to modify a number in a text and then repeat that block of text several times , and i have an exemple
POSX (10,23,11,19)
POSY (19,14,12,19)
L43,xf-rt0001,18
POSX (10,23,11,19)
POSY (19,14,12,19)
L43,xf-rt0002,18
POSX (10,23,11,19)
POSY (19,14,12,19)
L43,xf-rt0003,18
I want to make something like this with the underline number , number of times been given from a textbox , i mean if i write in the textbox 34 for exemple the block of text will repeat 34 times and the underline number will increas for 0001 to 0034 .
Thanks a lot again
|
|
|
|
|
Things to read up on
Loops, while and for loops will help
string.format for formatting your numeric into a string with the padded 0
You should get hold of a book[^], read through it and work the examples.
|
|
|
|
|
It's unclear exactly what you want to do - but pseudo code you want something like:
int startNumber = 1;
string firstLine = "POSX (10,23,11,19)\n";
string secondLine = "POSY (19,14,12,19)\n"
string thirdStart = "L43,xf-rt";
string thirdEnd = ",18\n\n";
theNumberOftimesIWantToRepeatIt 34;
for (int i = 0;i < theNumberOftimesIWantToRepeatIt; i++)
{
PRINT(firstLine);
PRINT(secondLine);
PRINT(thirdStart + (startnumber + i).ToString(D4) + thirdEnd);
}
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi All,
I want to design a custom window control which can be derived from textbox and to which i can add another control like month calendar or keyboard panel. I have tried user control for this but then i can't derive this from textbox and if i design a custom control that derives from textbox class then how i can add keyboard panel/ month calendar to it?
If i have to design a web control instead of window control then i can add controls to inherited textbox control via rendering the required html. but how this task can be done in window control?
[Addition]The idea in my mind is design it like user control and then expose the required properties/ event through the custom control. Is it a right solution? or is there a better solution for this problem?[/Addition]
|
|
|
|
|
Why are placing all that inside a TextBox? Maybe if you can tell the purpose of having such control, one can respons in a better way.
You can create a user control that will have a TextBox, and a Keyboard panel and a month calendar.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
It is posible to add extra control to a textbox by inheritance, but it is not simple. A drop down control can be added by dynamically displaying the dropdown control positioned relative to the textbox in it's parent at runtime in appripriate event eg. the right mouse click.
However most often you would want a User control to do this. It is much easier.
Out of interest, why would you want a keyboard drop down on a windows app? Or are you developing for Windows mobile? Sorry, even then it does not make sense to me. And a calendar drop down only makes sense on a date picker which already has one. What is it that you really want to add to the textbox?
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Create a UserControl and add the constituent controls in it, for example, text box, month calendar, etc. Expose the properties, events and methods of the constituent controls by creating properties, events and methods for the UserControl and mapping them to the constituent controls. For example:
class MyTextBox {
TextBox textBox1 = new TextBox();
EventHandler TextChanged;
public MyTextBox() {
textBox1.TextChanged += EventHandler(textBox1_TextChanged);
}
public string Text {
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
private void textBox1_TextChanged(object sender, EventArgs e) {
if (TextChanged != null)
TextChanged();
}
public void Clear() {
textBox1.Clear();
}
}
Custom controls can only be used to extend the functionality of an existing control. You cannot add additional controls to it.
|
|
|
|
|
Thanks to all for taking intrest in my problem. Now i just understood that i am making some mistake. When i searched CP more, i got this article A Touch Screen Keyboard Control in WPF[^]. It was my exact requirement but i have to design a window control not WPF.
Now i got the idea from this article that i should display the keyboard panel as another window not to include panel in the control itself.
|
|
|
|
|
If you really need a new window for the keyboard, fine. Or else you can create a user control with SplitPanel where one panel will have the textbox and other would have the keyboard.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|