my question is that is there any method in C# by which we can highlight the row of access database after certain action ?? if not then either we can highlight the row in datagrid ?? plzzzzz reply soon
swtlibra
Posts
-
highlighting the row of the access database -
error in combobox databindingbut it still giving the same error
-
error in combobox databindingi m trying to fill the combo box with the data from the access database but i m getting the error "Object reference not set to an instance of an object." i m writing the following code for the purpose
con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=practicedatabase.accdb");
con.Open();
string qry = "Select * from cat_table";
dadapter = new OleDbDataAdapter(qry, con);
dset = new DataSet();
DataTable dt = new DataTable("cat_table");
dadapter.Fill(dt);
this.comboBox1.DataSource = dt;
this.comboBox1.DisplayMember = dt.Columns[1].ColumnName; -
selecting data from excel sheetthnx for ur reply but it is simply the binding of excel sheet to datagrid but i have to copy selected data from excel sheet means when user click on certain record in excel sheet it gets copied in datagrid okzzz and plz do tell me also that how to open excel sheet with program for copying the data from it thnx in advance
-
selecting data from excel sheeti have to write a code for for copying a selected data from excel sheet to data grid now i m confused that whether i have to open the excel sheet with the program of had to show it to the form because i can't show the whole sheet to the datagrid (as its a requirement of a program) and after opening the sheet how i can copy the data from excel sheet display it on the datagrid any ideas ??????
-
estblishing a conection of a excel sheet with C# applicationi m trying to connecting the excel sheet with C# application but getting the error "External table is not in the expected format." i have written the following lines of code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;public partial class excelform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create connection string variable. Modify the "Data Source"
// parameter as appropriate for your environment.
string conn = ("Provider=Microsoft.Jet.OLEDB.4.0;" +
("Data Source=" + Server.MapPath("excelsht.xlsx") +
// or use instead of Excel 8.0 - Excel 5.0
";Extended Properties=\"Excel 8.0;\""));
string SSQL = "SELECT * from [excelsht$]";// here use oleDataReader OleDbDataAdapter oleDA = new OleDbDataAdapter(SSQL, conn); DataSet ds = new DataSet(); oleDA.Fill(ds); GridView1.DataSource = ds.Tables\[0\].DefaultView; GridView1.DataBind(); }
}
-
deleting a specific recordis there anyway to delete a specific column from a record like in a table Employee Employee_ID, Employee_Name, Employee_Image, Description Is there any way to delete Employee_Image from one row if yes then how?? i m using C#.net with access database thnx
-
data insertion in gridviewi m using C#.net application with access database i want display the data in grid view from multiple tables like the column should display "serial number" from table1 and second column sholud display "Name" from table2 and so on any idea how to cater multiple tables with the gridview thanks
-
Image in a gridviewwhere to give the path plz tell about the code
-
Image in a gridviewok if we use a simple code then how the image will be displayed using code through code simple data is displaying in the grid
-
Image in a gridview<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Image_ID" AllowPaging="True" onrowdatabound="GridView1_RowDataBound" onselectedindexchanged="GridView1_SelectedIndexChanged"> <Columns> <asp:BoundField DataField="Image_ID" HeaderText="Image_ID" InsertVisible="False" ReadOnly="True" SortExpression="Image_ID" /> <asp:TemplateField> <ItemTemplate> <asp:Image ID="img_1" ImageUrl='<%# Bind("Image_1") %>' runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:ImageField DataImageUrlField="Image_1"> </asp:ImageField> <asp:ImageField DataImageUrlField="Image_2"> </asp:ImageField> <asp:ImageField DataImageUrlField="Image_3"> </asp:ImageField> </Columns> </asp:GridView>
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.OleDb; using System.IO; public partial class samplepage : System.Web.UI.Page { OleDbConnection con; OleDbCommand cmd; OleDbDataReader rd; OleDbDataAdapter da; DataSet ds; //Directory.CurrentDirectory; protected void Page_Load(object sender, EventArgs e) { //Directory.CreateDirectory(@"~\Upload\"); con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("App_Data/testdb.mdb")); Load_GridData(); } void Load_GridData() { con.Open(); //open the connection OleDbDataAdapter da = new OleDbDataAdapter("select Image_ID, Image_1, Image_2, Image_3 from Images", con); DataSet ds=new DataSet(); //DataTable table = new DataTable(); da.Fill(ds); // Fill the dataset GridView1.DataSource = ds; // give data to gridview GridView1.DataBind(); con.Close(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void G
-
Image in a gridviewwhen i remove the datasource ID from gridview it dosen't display the whole grid view :(
-
Image in a gridviewi m trying to display the Images in a grid view with refrence to the following article it is the article if Abhijit Jana on code project but i m getting the following errors error: Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition. in the following lines GridView1.DataSource = ds; // give data to gridview GridView1.DataBind(); can anyone help me ??
-
Image Viewerand wht about buiding a viewer???
-
Image Vieweri have to build the image viewer in C#.net application these images would be displayed from the access database any ideas how to start building it or any tutorials suggessted for the beginners either i have to use GDI+ or not how i should start studying ??? plz can any one help
-
How to store picture into database and retrievali have a code in C# for access database make an upload folder in your project file Label1.Text = Server.MapPath(@"~/Upload/" + FileUpload1.FileName.ToString()); FileUpload1.SaveAs(lbl_path.Text); Image1.ImageUrl = "~/Upload/" + FileUpload1.FileName; Label1.Text = FileUpload1.FileName; and now through insert command save Label1.Text into your database and for retrieving the picture and for retrieving the picture use select command give id of that row in some textbox cmd=new oledbcommand("Select Image from Images where ID='"+textbox1.text+"'",con); rd=cmd.executereader(); if(rd.read()) { textbox2.text=rd["Image"].tostring(); Image1.ImageUrl=@"~\upload\"+textbox2.text; } hope it works
-
displaying selected recordsi m using C#.net app with access database i have a employee table with the following columns Sr.NO(PK), Employee_ID, Category_ID, Image_ID, Description i want to display the records on the basis of category selected from drop down and then following that Category ID i want to pick the relevant Employee_ID and want to display the name from another table on the basis of that ID any idea how and where to display that record ??
-
textbox with numbersi m using C#.net application with accessdatabase i m trying to display primary key in textbox but it is giving the error "data type mismatch" the primary key datatype is "Autonumber" can anyone tell me that how to make textbox compatible with numbers thnx
-
saving multiple data enteriesi m working with C#.net and at the back end access database i have four tables in my database category Images employee & empinfo the first three tables above have the primary keys made foriegn keys in the table of empinfo now i need a code in C#.net how to store all the information in the tables of "category", "Images" and "employee" and finally in the table of "empinfo" new to C#.net programming plzzzzz can anyone help???? :((
-
navigation through recordsthank you so much for ur idea i m a new to C#.net it helped me a lot :) :-D :cool::thumbsup: