Click here to Skip to main content
15,893,190 members
Everything / DataReader

DataReader

DataReader

Great Reads

by ASP.NET Community
Confused how to use DataSet and How to use DataReader?I am trying to give some of basic understanding about and differences between DataReader
by Mehedi Shams
Create a data dictionary for your database tables
by Jörgen Andersson
A propertymapping extension for DataReaders
by Alejandro Xalabarder
Yet another XML to database aproach

Latest Articles

by Praveen P R
This article presents a simple and efficient way to bulk insert any .NET list to the database.
by Mehedi Shams
Create a data dictionary for your database tables
by Jörgen Andersson
A propertymapping extension for DataReaders
by Alejandro Xalabarder
Yet another XML to database aproach

All Articles

Sort by Score

DataReader 

11 Oct 2013 by ASP.NET Community
Confused how to use DataSet and How to use DataReader?I am trying to give some of basic understanding about and differences between DataReader
7 Sep 2014 by OriginalGriff
Remember that this will be comparing only against the last matching row in the database that your query returns: and we don't know what your query is.So if you have a dozen rows with "Male" and then one row with "Yes please" then the comparison will only compare "Yes please" against "Male" and...
1 Oct 2012 by OriginalGriff
You haven't set any of the parameters you specified in the command string: SqlCeCommand code_comm_two = new SqlCeCommand("SELECT transmission_code FROM vehicles WHERE make = @make AND model_name = @model AND model_year = @model_year AND engine_type = @engine_type", conn);You have...
24 Feb 2013 by vishal.shimpi
try the following solution...Once your retrieve data from database to DataTable the add one new column in the same data table like Assume your datatable name is dt then write, dt.Columns.Add(new DataColumn("Total", typeof(decimal))); foreach(DataRow dr in dt.Rows) { dr["Total"]...
21 Mar 2013 by OriginalGriff
You haven't executed the command, os the chancesa re that the reader is not initialized. Try:selectCommand.Parameters.Add("@COOP_ID", SqlDbType.Int).Value = txtIdCoop.Textdr = selectCommand.ExecuteReader()While dr.Read ()"I fix it but they are now without the @ am I vulnerable to...
23 Apr 2013 by Pallavi Waikar
it is because u r already reading value from reader remove this line from code datareader.Read()i.eProtected Sub btnAddUser_Click(sender As Object, e As EventArgs) Handles btnAddUser.Click Dim conn As New SqlConnection("Data Source=BRIAN-PC\SQLEXPRESS;Initial...
23 Apr 2013 by ZurdoDev
You called .Read() twice on the DataReader. So it has advanced too far.Since you are only expecting one user record try something like this insteadIf datareader.HasRows THEN datareader.Read() user_id_select = datareader("user_id")End If
14 May 2013 by CHill60
To improve performance you need to minimise the use of the Excel COM interface.I would suggest converting your list of objects to a datatable first and then exporting that to excel ...Here is a generic way to convert a list to a datatable Converting a List to Datatable[^]and here's how...
14 May 2013 by Maciej Los
If you fetching data from database, the fastest way to export data is to use CopyFromRange()[^] method for MS Excel range.More about: How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET[^]
3 Dec 2013 by GC Kachhadia
I Have Perfect Solution For SQLCE Datareader....Now You Can Use Like This.................Dim cmd As SqlCeCommand Dim dr As SqlCeDataReader Dim i As Int32 = 0 cmd = New SqlCeCommand(str, con) dr = cmd.ExecuteResultSet(ResultSetOptions.Scrollable) ...
20 Apr 2014 by OriginalGriff
That code is...um...odd.You create a command (which is commented as a SELECT), execute it, but throw away the results, and then dispose of it, and close the connection.Then you try to do an INSERT operation...which presumably is giving you a problem.The SELECT code does nothing useful:...
8 Feb 2015 by Kornfeld Eliyahu Peter
Finally I was able to see the image you posted (better explain it by words), and understood that some of the values (those with $ in it) return as empty...The problem is that Excel has no data type, so the OELDB driver have to decide what datatype to assign to every column upon reading...
12 Jul 2015 by phil.o
With your actual table design, when you change the score of a record, you have to recompute the ranks through all the table.You may consider getting rid of your Rank column, and compute the rank in the query instead. Something like:SELECT t.Id , t.Score , ROW_NUMBER() OVER (ORDER...
19 Aug 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Make a query to the second table by passing the customer id selected.So you will get two rows. Read the code values one by one by reader. Inside reader, use CheckBoxListId.FindByValue(code) to get the checkbox with that code. Then select it.
18 Aug 2016 by Karthik_Mahalingam
try using SqlDataAdapter [^]SqlCommand sqlCommand = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(sqlCommand); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 1) { Session["Cus_name"] =...
4 Oct 2016 by OriginalGriff
The DataReader isn't "faster", it just defers the "download" of the records until you ask for them, which the DataTable / DataSet approach returns when the complete set of records have been assembled and returned to your code. The DataReader takes the same time - or even longer - to process all...
8 Dec 2018 by Wendelius
Taken that the id is created using an identity definition[^] there are three system functions that return lastly inserted identity value: - @@IDENTITY (Transact-SQL) | Microsoft Docs[^] - IDENT_CURRENT (Transact-SQL) | Microsoft Docs[^] - SCOPE_IDENTITY (Transact-SQL) | Microsoft Docs[^] ...
14 Feb 2022 by Richard MacCutchan
You have four columns in your database, the first is car_ID which contains a number only. So when you want to use that in a WHERE clause you must use only that value. Passing a string like "3 CHEVROLET EQUINOX 2017" will never match. If you want...
14 Feb 2022 by Maciej Los
A combobox[^] control has got 2 most important properties: - DisplayMember[^] - ValueMember[^] You can use them in your MileageTrack_Load method: private void MileageTrack_Load(object sender, EventArgs e) { ...
13 May 2022 by Richard MacCutchan
The problem arose due to a mis-spelled table name. The exception message from OLEDB did not help.
22 Aug 2012 by CherishLife
Hi all,We have a problem with multiple user access. When two users clicking same button at same time, One is able to get data and other getting an error 'Invalid attempt to read when no data is present'.Inner exception :System.InvalidOperationException: Invalid attempt to read when no...
30 Sep 2012 by Member 8054943
Im fairly new to VB.net and SQLite...I have a subroutine which writes data to a db using data adapters and datasets.This whole sub below works fine. It just looks very long and time consuming for such a simple task. I might want to do this 1000's of times and each time I have to create a...
19 Oct 2012 by Rohit Shrivastava
You have to use for IsDBNull or DBNull.Value.if (! DBNull.Value.Equals(cla_filenames_dr.GetString(0))) should be changed to if (! DBNull.Value.Equals(cla_filenames_dr[0]))orif (! cla_filenames_dr.IsDBNull(0))Whenever you try to call GetString, it is expected to get a string...
19 Oct 2012 by OriginalGriff
I agreed with Rohit that the root cause of your problem is the DBNull - as your error message clearly states.When you run this query in SSMS it handles the display of the null itself, so you never have to worry about it. But when you code it, you have to handle the return value yourself, and...
8 Nov 2012 by Maciej Los
I'm not sure what you really want to achieve...Please, start here: http://www.dreamincode.net/forums/topic/157830-using-sqlite-with-c%23/[^]Then read this article on CP: Using SQLite in your C# Application[^]More about SQLite you'll find at: http://www.sqlite.org/[^]
8 Nov 2012 by A N Saraf
Use INSERT INTO Query to insert single row in datatable insted of DataAdaptersVisit This Link to know more on INSERT INTO Syntax Click Here
24 Feb 2013 by Nasser Abu Farah
HiLets say that I have a table with three columns. Name, Salary, Bonus.Now I want to create a gridView to represent the data in the table with a fourth column contains the bonus calculation ( salary * bonus).In other words, I will have a three columns table, and a four column...
24 Feb 2013 by Nasser Abu Farah
first of all thank you for your interesting,regarding the second comment by Sandeep Mewara, I read the data and made my calculation in a dataReader, but I don't know how to assign the value to a new column and and make the new column appear in the gridView.what I am really trying to do is...
24 Feb 2013 by Avik Ghosh22
SqlCommand cmd = new SqlCommand("SELECT * FROM RNDTABLE",con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt=new DataTable(); da.Fill(dt); dt.Columns.Add("GROSS_SAL", typeof(decimal), "(SAL +(SAL*.10))-100+5");GridView1.DataSource = dt; ...
23 Apr 2013 by Member 9978591
Hi,Can anyone tell me why datareader is no reading user_id from this code?I debugged and the user_id_select remains 0 and I am getting no errors. Protected Sub btnAddUser_Click(sender As Object, e As EventArgs) Handles btnAddUser.Click Dim conn As New...
23 Apr 2013 by OriginalGriff
Brackets, my friend, brackets.Change: searchSQL.Parameters.AddWithValue("@username", txtUserSearch.Text.ToString)To: searchSQL.Parameters.AddWithValue("@username", txtUserSearch.Text.ToString())But in fact you don't need the ToString at all, since a Text property...
13 May 2013 by Am Gayathri
In my code am getting following error.ORA-06550: line 1, column 7:PLS-00306: wrong number or types of arguments in call to 'SAVE_DATA'ORA-06550: line 1, column 7:PL/SQL: Statement ignoredWhat will be the reason for this?code am using is, List listparamters =...
13 May 2013 by V.
If you type "ORA-06550" in google (or any other ORA error) you'll get the explanation. In this case, not much of help as it seems to be a generic error. My guess is that it might be because you add prm3 twice (not sure though): //btw is "paramters" a typ-o ? ...
13 May 2013 by Am Gayathri
The problem is with objDataAccessUtilities.ExecuteDataReader(command); instead of this we have to useobjDataAccessUtilities.ExecuteNonQuery(command);
21 May 2013 by Am Gayathri
is it possible to display values from data reader to crystal report in vb.net??my code isImports System.DataImports Oracle.DataAccess.Client ' ODP.NET Oracle managed providerImports Oracle.DataAccess.TypesDim oradb As String = "Data Source=orcl;User Id=hr;Password=hr;"Dim conn...
21 May 2013 by Prasaad SJ
You can use the following codeYou can first convert the datareader to datatableDataTable dt = new DataTable();dt.Load(dr);// Then you use the use that directly to the reporyReportDocument report = new ReportDocument();report.Load(Server.MapPath("~/Reports/bydos.rpt"));//Your...
1 Jun 2013 by teledexterus
I would like to add up every row in a column.I know I am missing a integer changing thing on dr(i).If there are easier methods please let me know.Sub Add() cmdStr = "SELECT [col3] FROM [table1];" End Select i = 0 connStr = "server=myServer;initial...
1 Jun 2013 by CHill60
1) To select sum from the database use something like..cmdStr = "SELECT SUM(col3) FROM table1"2) For getting integers from sqldatareader use dr.GetInt...sqldatareader example from dotnetperls[^]
13 Jun 2013 by Jiban jyoti Rana
I want to read data from database using a data reader.I have a text box and a click button.When i enter data in the textbox and click search then it should display the data .How to do it with Datareader and display the in a gridview?Please help me out..
14 Jun 2013 by Surendra Adhikari SA
Its better to use DataAdapter to fill a datagridview from database .Data reader used mostly where we have to fetch and process data row one by one.i.e. Dim ConnStr As String= "your connection string" Dim SConn As System.Data.SqlClient.SqlConnection Dim SqlStat As String="select...
19 Jun 2013 by Kashif Alvi
I developed an application using Microsoft access as the database but now i want to switch to sql compact edition.My code is as underPrivate Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dr As SqlCeDataReader Try ...
19 Jun 2013 by Ron Beyer
You have to call .Read before you call .HasRows
19 Jun 2013 by Mohamed Mitwalli
Hi , Check this There is no member called HasRows in .NET Compact Framework.http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcedatareader_members%28v=vs.71%29.aspx[^]but for the rest of your code i believe it will work but there is some methods and member not supported...
15 Oct 2013 by mareksip
Hello guys, I have this code:public void chyt_data() { SqlCommand novyprikaz = new SqlCommand("SELECT * FROM table WHERE akce="+nc_zajezd_vyber, spojeni); spojeni.Open(); SqlDataReader precti = novyprikaz.ExecuteReader(); ...
5 Jul 2013 by Sadique KT
zcena1.Text=precti[columnName/index].ToString();
31 Oct 2013 by arunrk87
Out of no help in Google, I came here to ask this.I have a table named Agent with columns AgentId and AgentName in Sql Server DB. Using Visual Studio 2008(VB.NET), I am developing a windows based app. I have a ComboBox control in a windows form. I need this ComboBox control to be filled with...
31 Oct 2013 by prashant patil 4987
try below:ComboBox.Items.Add("Select Agent")ComboBox.DataSource = DataSet1.Tables(0)ComboBox.DisplayMember = "AgentName"ComboBox.ValueMember = "AgentId"ComboBox.DataBind() // Add This Line into Your CodeComboBox.SelectedValue = "Select Agent"
11 Nov 2013 by prashant patil 4987
Refer below link http://code.msdn.microsoft.com/windowsdesktop/ComboBox-Databinding-ab61d9d5[^]
20 Nov 2013 by arunrk87
Got it! check the link belowhttp://stackoverflow.com/a/14868976/194276
3 Dec 2013 by GC Kachhadia
SqlCeDataReader dr = cmd.ExecuteResultSet(ResultSetOptions.Scrollable)
8 Feb 2014 by Abdullaziz Said
hello i want to create a dynamic controls depended on value comes from dgh here is my code cn = new SqlConnection(ConfigurationManager.ConnectionStrings["lap_connection"].ConnectionString); cmd = new SqlCommand("SELECT COUNT( pat_id) AS patient_test FROM...
8 Feb 2014 by CPallini
Quote:textghox txt = new textghox();What is a 'textghox'? Do you mean TextBox[^]?
8 Feb 2014 by Karthik_Mahalingam
use Page_init for getting the values of dynamic created controls in post back.check this Dynamic controls retain after postback[^]
20 Apr 2014 by R.BinayRam
con = new SqlConnection(connetionString); try { con.Open(); cmd = new SqlCommand(sql, con);// SELECT query has been invoked in Sql cmd.ExecuteReader(); cmd.Dispose(); con.Close(); ...
25 May 2014 by Davidemazzuuu
I want to write a list of all users with their addresses and then compose html. I need your opinion public class User{ public int ID { get; set; } public string Name { get; set; } public string Surname { get; set; } public List Addresses { get; set;...
25 May 2014 by SRS(The Coder)
Correct, you should use some existing asp.net data controls rather than doing this.Also it is better practice to get data in a chunk rather than getting row by row using datareader. Just get the data and have it in DataSet then bind the data control with the data retrieved. Only refresh data...
24 Jun 2014 by bginsburg
I'm trying to cast DataTableReader to NpgSqlDataReader (its an abstract class) with no success. tried inheriting from it but than i cant because it has internal function that could not be override. The final thing im trying to do is move an object of NpgSqlDataReader from one process to...
20 Aug 2014 by Abdullaziz Said
hello i write c# code to check if the user type = 1 depended on value comes from datareader but i got this error Invalid attempt to read when no data is presentthis is my code protected void Page_Load(object sender, EventArgs e) { string name = ""; if...
20 Aug 2014 by Gihan Liyanage
if you have more than 1 result, you can doSqlDataReader dr = cmd.ExecuteReader();while (dr.Read()) { // read data}
4 Sep 2014 by furynight8
Hi All,Greetings!!!I am facing a issue with IDataReader when trying to read a row from Database. I am having IDataReader object called objDataReader. The results are looped using while loop as below.while(objDataReader.Read()){ // doing some work}Due to some problem in...
4 Sep 2014 by OriginalGriff
Probably, you can't: ORA-01062 is an Oracle error, not a .NET error - and that means it's the database server that is complaining and causing the problem, not the .NET framework or your C# code.You need to start delving into Oracle: Google "ORA-01062"[^] may be able to help.
13 Nov 2014 by DHicks19
Hi, I am wondering what is the best way to populate a UI dropdown from a sql database table.Is it best to have a specific method in the data access layer for each and every drop down in the UI and use a data reader?Do I then call this method from the middle layer and then call this from...
13 Nov 2014 by IpsitaMishra
It depends upon your requirement.You can create a single stored procedure for getting all the drop down data in your application.And a single service method that call the sp and return the data .You can create a common class called DropDownList.Which may look like thisPublic Class...
12 Dec 2014 by bobb024
Hello,in my IDataReader I am reading results from my stored procedure with help of the enterprise library. The problem is I have two columns on different tables that hold different values but are named the same thing, so when I have AddressID coming back with the same value when...
12 Dec 2014 by bobb024
public static List ToPersonListFull(this IDataReader dataReader){var returnList = new List();while (dataReader.Read()){var Person = new Person(){PersonID = Int32.Parse(dataReader["PersonID "].ToString()),Name = dataReader["Name"].ToString(),AddressID =...
19 Dec 2014 by Roger C Moore
I think these articles will give you and idea how to update the UI based on database values:Silverlight Application with Management Entity Framework and WCF ServiceAnd,MVVM Silverlight Application with Entity Framework and WCF Service[^]After reading these articles and...
8 Feb 2015 by Dev_Fady...
I am Using this code to read from excel but there are some cells{D2 , D4 }the prog . cant read them from the excel file which contain ('$') {D2 , D4} any help to read this cells ..try { OpenFileDialog ex = new OpenFileDialog(); ex.Filter =...
8 Feb 2015 by Richard MacCutchan
Most likely because what you see in Excel is the display format of a numeric value. When you read a cell's value you just get the number that is stored inside it. To get the formatting information you may need to use the Excel.Interop.
5 May 2015 by chandra sekhar
I have to fetch list of values from DB and display them in a dropdown, how can i fetch without passing anything.what to use in place of sqlparams??public List GetTimeZones(){ using (SqlDataReader dr = SqlHelper.ExecuteReader(DatabaseConnection.Connection,CommandType.Text,...
6 May 2015 by Harikrishna G
I guess you are looking for this,hope it will help youpublic DataTable GetAllEmployees() { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection(conString); try { SqlCommand cmd = new...
6 May 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You can return a DataTable and bind that directly. Let me update your code.public DataTable GetTimeZones(){ DataTable dtTimeZones = new DataTable(); SqlCommand cmd = new SqlCommand("sp_EP_GetTimeZones;", con); cmd.CommandType = CommandType.StoredProcedure; ...
29 Jun 2015 by Member 11796666
Dear My FriendsI am trying to do this: protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(ViewState["id"]); SqlConnection con = new SqlConnection(); con.ConnectionString = ""; string q = "select *...
29 Jun 2015 by Richard Deeming
The problem is most likely with the @id parameter value. In your Page_Load method, you use the value from the querystring parameter Code. In your Button1_Click method, you use the value from ViewState. At no point in the posted code have you initialized the ViewState value.The simplest...
10 Jul 2015 by Member 11796666
Dear My friends.I have a gridview. It is binded to a sql data bank. Sql has a table with some columns (name, photo, score, rank, id). My gridveiw shows some pictures which is saved in sql. The problem is that I could not show the rank. for example, I have two pictures, picture A has a score...
11 Jul 2015 by OriginalGriff
You don't "order tables" in SQL - you order them when you pull them from the DB as part of the SELECT query that you populate your tables and views with. If you do not specify an order then, then SQL is at liberty to server rows in any order it finds convenient - and that may not be the same if...
19 Aug 2015 by DoomMaker79
Dear All,I'm stuck with my asp.net webform using SQL. I have (let me simplify it for you) 2 tables:table1 has 1 column, named (ID) and data type of 'int'. It has now 61 rows with values of 1...61. Anytime I want to increase the possible values, I have to add it in SQL and not in ASP.NET...
19 Aug 2015 by DoomMaker79
Ok, thanks for your reply, it led me to the solution. It's very simple, I don't know why I couldn't resolve it earlier...So, after querying Table2 I changed the while(dr.Read()) part to this:while (dr.Read()) { ListItem li =...
6 Jun 2019 by Kunal Ved
I am mantaining an application which is in old 3 tier arch.Have a common method created that executes the store proc and returns dataset and binds the gridviewpublic DataSet Execute_StoreProc_DataSet(string psStoreProcName) { DataSet dsResult= new DataSet(); UtilParams...
26 Jun 2016 by OriginalGriff
Start by looking at the SP. What it does, how it does it.Execute it via SSMS and see how long it takes, and what it returns - you need to establish where exactly the bottleneck is before you can start changing things to improve performance.If the SP take 5 minutes to run, then you are...
18 Aug 2016 by Garvin12
Hi, everyoneI have a stored procedure which logs in a user and retrieves some data from multiple table, When i test the procedure with test data it returns all the fields i need, But in my application when i use a datareader to retrieve these values i get an Index out of range...
18 Aug 2016 by ZurdoDev
1. Don't use VisibleFieldCount. It is not what you think it is.2. Reference your data by using the field name. That will make things much easier to debug. For example:Session["Cus_name"] = reader["Customer_name"].ToString();
4 Oct 2016 by Michael Breeden
What was it, about 2002 that .Net gave us the DataAdapter/DataSet and the DataReader. All we needed to know then was that the DataReader was fastest. Well this is 14 years later in a corporate production environment after we're supposed to be using stored procedures after all the fighting over...
4 Oct 2016 by F-ES Sitecore
Use EntityFramework, it should give you the things you need. Under the covers it works out the dynamic SQL needed to fulfil your request and executes for you, abstracting away all the actual data access stuff. It basically makes your SQL tables behave like objects\lists in your code...
4 Oct 2016 by Mehdi Gholam
Personally I think it is a bad idea to split your logic, and put some in your database layer and use stored procedures other than for performance reasons when processing a lot of rows, for a couple of reasons:1) I makes development and changes harder and you have to "massage" your logic to...
4 Oct 2016 by Foothill
A very simple approach to this is to use parameterized queries for your dynamic SQL// brief example of what I use all over the placepublic DataTable LoadRecords(DateTime pStartDate, DateTime pEndDate){ DataTable results = new DataTable(); // parameterized query string sqlStatement...
10 Oct 2016 by Member 12723543
I am Trying to Get the Data from the column [MorningTime-In],[AfternoonTime-In] in the table Table_DTR . its Datatype is time(7) but I keep on getting an Error message: System.IndexOutOfRangeExcemption:[MorningTime-In] .What I have tried: Dim timeInAm As DateTime Dim...
9 Oct 2016 by Wendelius
The angle brackets, [], are used in SQL Server to surround names in SQL Server that contains special characters or are reserved words. However when the column is returned to the client, the actual name of the column is used.So try the following:timeInAm =...
2 Aug 2017 by sixxkilur
Hi all I have been trying to add some DB functionality to one of my apps and not having much luck. Please keep in mind not using Data set using Data reader. I have tried many ways to get my data from db to windows form into the picture box. I want the image to be placed in picture box based on...
19 Sep 2017 by Karthik_Mahalingam
check Boolean.TryParse Method (String, Boolean) (System)[^] bool isActive = false; if (bool.TryParse(rdr["Is_Active"] + "", out isActive)) { emp.IsActive = isActive } else { // show the error message to the user ...
12 Aug 2018 by $ultaNn
Error while using NextResult fuction with datareader cannot get second table result and error on second NextResult line " invalid attempt to call nextresult when reader is closed " using (SqlConnection myCon = DBCon) { try { string Qry = @"SELECT...
15 Mar 2021 by TheBigBearNow
Hello everybody, I have a DataGrid that is being populated from a DataTable by a SQL database. My SQL creates a list of objects and I create the datatable and columns dynamically. I am trying to set the column width of each column so I can specify them to whatever width I want. My grid view is...
8 Dec 2018 by TheBigBearNow
Hey all, I have my code to I can create a new receipt NEXT I am supposed to add my list of products to another table linked by my receiptId But my database automatically creates the receiptId and the only way to read the receipt from the database is if I have the receiptId So how would I get the...
14 May 2020 by Doctor GME
This is My Design: https://www4.0zz0.com/2020/05/13/03/372544645.jpg[^] and this is my database design: https://www10.0zz0.com/2020/05/13/03/171174839.jpg[^] with CmbInfoType selected index changed event the text string from the data reader...
14 May 2020 by Maciej Los
You're doing it wrong! If you want to load text from file in assemblies and display it in richtextbox depending on selection in combobox, you have to "translate" text into assembly resource. How? Follow the instruction: .net - How to read...
15 Mar 2021 by aherceo
public ProductsList() { InitializeComponent(); CreateProductList(); DataTable dt = DataTableProductList(productList); // it is assumed that productList is a public variable of type List ...
14 Feb 2022 by Blue Ocean
My Project Details: Visual Studio WinForms C# SQLite; a simple form to retrieve mileage records from the autos selected. I have a combobox populated with the following from query: query = sqlite_datareader[0].ToString()+" "+...
14 Feb 2022 by Blue Ocean
Hey All, I am posting the solution of what worked for my code for anyone in the future that may need help. Im sure others could do a cleaner job, but this worked for me. using System; using System.Data; using System.Data.SQLite; using...
13 May 2022 by BobbyStrain
I am working with a windows form in C#. I am using a datareader to populate a listbox. However, I get a message when I ExecuteReader "No value given for one or more required parameters". But I can't find anything wrong. Can you point me in the...
27 Oct 2022 by NPetey
I am using VB.Net Windows form with a Datagridview and a retrieve button. The form is used by end users who paste job number numbers in column 0, then click the retrieve button and the data from the database will display in the grid. The code I...