ADO.NET Project - c#

I'm trying to create a project which is basically a library management system.
As a display I used the standard DataSource to WinForm drag and drop system, which displays everything shown in the SQL table.
I want the users to be able to see the content of each row in the grid by double clicking it, which would redirect to another page with the selected row number and information to be displayed on each field.
As for the admin side, I want to be able to modify my db (delete, insert).
Is this the right path, or should I draw a grid from scratch?
Also, my SQL table contains images, this is what's bugging me.
The default gridview shows the little red X's in the varbinary column, and I can't seem to get rid of that.
Regarding inserting data into the table, is there any way to add images directly from the system above? Or should I redirect to a new page and code the respective into textboxes and things of the sort?
Thank you in advance.

Related

Crystal Report not showing correct data

Hi I am designing a report using Crystal Report in VS 2010 C# to show students details.
I have designed the Crystal Report like below.
and my actual database table data is
but I am getting output is
What will be the problem?
Ashok as per your question information there might not be any error in your coding but might have error in Cristal report or Application setting.
Check your both that applications and try again.
It’s not quite clear what the issue you have at the moment. But based on your comments there are few areas that I think can be gone wrong.
Check you have correct data source set up (Right click on student under Database fields and go to set data source location and check you are connected to correct database and table)
Also go to file and check whether you have save data with report option is selected. If it is unselect that option
Try go to database and do verify database
Reason behind you seeing values like ###### is definitely because of not enough space been allocated
Hope this helps
You see the "######" because the field itself is not big enough to display the data. There are two ways you can solve this:
Click on the field to highlight it. Then move the mouse along the frame until the cursor changes to an arrow that points left and right ( <-->). Click and hold the left mouse button and resize the field (just like you would resize a window).
You can right-click on the field, select Format Field, and under the common tab you can check the "Can Grow" option.

Showing Database Content in a Certain View on a Web Page

Ok so here is what am thinking. Am making a recruitment website to hire people. It gives a functionality to the applicant that he can build his cv online! i have made various forms for that.
After filling the forms the applicant will submit the information to database and then am saving all of the information from the webpages related to building cv in the database!
Am thinking of providing the applicant a tab on which when he clicks "View CV" and i show him the cv he built on a new web page in the format like this
http://careers.telenor.com.pk/Page/Detail/VacancyView.aspx?PositionID=3003265
Like the fields should be on the left as table columns and their respective content in the database on the right! Can anybody completely guide me how i can do that ?? or direct me to a specific tutorial ?? i would be grateful! Am using Asp.net!
I have seen grid view! Much like a table it is! with columns on the top and below the values in the database! That is not the thing i want!
DetailsView control can be used to display fields from a single data record. It has that "format" you are looking for.
You can find documentation in this link http://msdn.microsoft.com/en-us/library/s3w1w7t4.aspx

Is Gridview Control a complete solution for Web based SQL Server Database Table Editor?

After a few failed attemps of integrating the existing Web based sql table editors to my solution, I have decided to write my own Web Based Sql Server table editor and I am thinking of using Gridview control for all the online processes on my database, here my questions:
1- Does Gridview a complete solution for SQL Server Database Table
Editor ?
2- Does Gridview the best way to do this?
P.S: What I am tring to do is creating an online admin panel of my application for an end user.
Couple of grid views and additional objects (for image viewing for example) should be enough for basic data editing.
GridView will allow you to view and edit most fields (except binary and images) from SQL table so in this respect it would work. With lookup tables you would need to use another grid view, maybe in read-only mode. It depends what you expect to have in your table editor.
You can use a sqldatasource control bound to a gridview for each table you need to manage. Sqldatasource will create CRUD operations with a wizard and Gridview will generate columns and commands automatically.
As above, you will work a bit to manage images properly, but all other fieldtype can be managed on the fly.
Datagridview is capable of operations in tables in a web interface, however auto creating a datagridview table when there is a new table added to the database is the hard part. For that reasion creating such an admin menu needs hard working, however if there won't be so much table in the application, you can create your admin panel manually with datagridviews instead of writing an own sql table editor tool.

Display specific image from SQL database with image control

I have a search page that a user can use to search for certain information about a device (ex. computer) that has been entered into a SQL database. They can search for Brand, Type, Hard Drive Capacity and other things. Once they click the search button, results are displayed in a repeater control. The DeviceID for each device is clickable and when clicked, it takes the user to another page that has all the details about that certain device. I want to be able to display the image for that certain device on that page, as well as all the other information. I have the image being saved as Image type in my SQL database. But I can't figure out how to get it out of my database and display it on the page. I've tried a few different approaches including displaying it in a grid control, which didn't work. I also tried using ASHX files but couldn't quite figure that one out either. I am using C# and ASP.NET. Any help would be greatly appreciated. If any code is needed, please let me know and I will be glad to post it. Thanks!
First hit on Google:
Retrieve Images from a SQL database for display in an Asp.Net Datagrid
Was able to solve this kind of issue using a Handler (ASHX). there are a lot of samples online. try this .. http://www.aspdotnetcodes.com/Insert_Images_Database.aspx

How can i fetch Database column names and how can i manage it

Problem:
SQL Server table is vertical grid with options, i want the same thing to be done in asp.net with c#,
i want to connect the system with the table, it will fetch table column names with check boxes on front, and when we would check or uncheck, the value would be stored in sql server table, as we edit using SQL Server management studio, i want the same component vertically integrated into my web application. Please let me know, can we use grid vertically or there is some control for this?
You will have to iterate through the properties of the table you want. Display this information in a format that you like, and then write various small queries to edit whatever you want to be editable.
http://www.codeproject.com/KB/database/DatabaseSpy_CS.aspx
http://www.sqlrecipes.com/sql_questions_answers/how_get_table_structure_via_sql-92
http://www.google.com/search?ie=UTF-8&q=SQL+Table+Structure+c%23

Categories