How to display a list of the database? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Please tell me how to get a list of all existing SQL Server database instances into a listbox , so that the user can select their database. Thank you!

You'll want to use the sys.databases table for that probably;
SELECT name
FROM sys.databases

Related

Is there any alternative for string.Join() inside Select statement of IQueryable? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
SQL server does not understand C# inbuilt functions.
I would put skills as a collection instead and than join on presentation (Transform it in the controller or wherever you send it).
Sills = cjdb.jclsf.Select(i => i.sr.Name)

How to delete single record in details list with same Id in asp.net mvc [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I'm working on a project in which i have to deal with Staff accounts and in Accounts details i have more then one enteries with same id and I want to delete single record from the list without effecting others row with same Id
You should make it unique first. You can, for example, use the id=id_index so in this case when you are deleting it is unique.
Also, if it is just removing from the interface you can use 'this' keyword inside change event by using jquery.

select top values from table [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I run the following query from C#:
SELECT TOP 100 colNamae FROM tableName
If the number of rows in the table is less that 100 - should I treat it in some way?(as catch exception etc)
While testing nothing happened - any error.
No , what you are doing is perfectly fine.

How do I pull existing, hidden fields from database? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to avoid having hidden fields being overwritten when I post to the database. What code is needed in my Get/Post in order to pull existing fields and ensure they are maintained after the user clicks save?
I'm using sql/mvc 4/c#.

How can I retrieve a record from a SQL database into my program using c#? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can I retrieve a record from a SQL database into my program using c#?
My database name is lightsandsounds, the name of the table is tbl_reservation, and I would like to get the value of the field fld_number into the textbox1 of my program. Your answers would be great help. Thank you.
Start by using these...
A keyboard
and a mouse..

Categories