how to import datagridview to datatable in c#
C#
public DataTable GetDataTable()
{
DataTable dtLocalC = new DataTable();
dtLocalC.Columns.Add("splr_Slno");
dtLocalC.Columns.Add("splr_Cntctnm");
dtLocalC.Columns.Add("splr_Cntctdesig");
dtLocalC.Columns.Add("splr_Cntctmoblno");
dtLocalC.Columns.Add("splr_Cntctemail");
DataRow drLocal = null;
foreach (DataGridViewRow dr in dgvSpplrfrm.Rows)
{
drLocal = dtLocalC.NewRow();
drLocal["splr_Slno"] = dr.Cells["splr_Slno"].Value;
drLocal["splr_Cntctnm"] = dr.Cells["splr_Cntctnm"].Value;
drLocal["splr_Cntctdesig"] = dr.Cells["splr_Cntctdesig"].Value;
drLocal["splr_Cntctmoblno"] = dr.Cells["splr_Cntctmoblno"].Value;
drLocal["splr_Cntctemail"] = dr.Cells["splr_Cntctemail"].Value;
dtLocalC.Rows.Add(drLocal);
}
return dtLocalC;
}
Also in C#:
- Title
- c# post request
- Category
- C#
- Title
- c# 2 timespan return yesterday
- Category
- C#
- Title
- how to name GameObject in c#
- Category
- C#
- Title
- unity change the source image or image
- Category
- C#
- Title
- copy a list in c# unity
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds
- Category
- C#
- Title
- exception handling c# stack overflow
- Category
- C#
- Title
- unity getcomponent
- Category
- C#
- Title
- start a particle effect when a button is pushed
- Category
- C#
- Title
- how to deactivate objects through scripts in unity
- Category
- C#
- Title
- open link c#
- Category
- C#
- Title
- how to get array of children transform
- Category
- C#
- Title
- unity randomly generated numbers c#
- Category
- C#
- Title
- csharp first element of array
- Category
- C#
- Title
- c# how to take from a float
- Category
- C#
- Title
- get day month year from date c#
- Category
- C#
- Title
- unity connect to firebase
- Category
- C#
- Title
- rotatearound unity
- Category
- C#
- Title
- weakreference tryget c#
- Category
- C#
- Title
- how to trigger event when a com device is connected in c#
- Category
- C#
- Title
- c# using get set methods
- Category
- C#
- Title
- unity main texture not working
- Category
- C#
- Title
- uncaught syntaxerror invalid or unexpected token unity webgl
- Category
- C#
- Title
- c# remove specific character from string
- Category
- C#
- Title
- asp.net textarea disable resize
- Category
- C#
- Title
- c# delay
- Category
- C#
- Title
- array to list C
- Category
- C#
- Title
- c# EncoderParameter
- Category
- C#
- Title
- c# input integer
- Category
- C#
- Title
- IEnumerator
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- whats a string
- Category
- C#
- Title
- how get data from json in c#
- Category
- C#
- Title
- unity how to set an objects postion x,y,z
- Category
- C#
- Title
- set object to random color unity
- Category
- C#
- Title
- how to make rb.addforce 2d
- Category
- C#
- Title
- how do I attach a player with a navMeshAgent
- Category
- C#
- Title
- check if number is even or odd c#
- Category
- C#
- Title
- unity get all by tag
- Category
- C#
- Title
- get web config key value in c# razor view
- Category
- C#
- Title
- Assets/Scripts/Snake.cs(187,10): error CS0029: Cannot implicitly convert type `UnityEngine.Vector2Int' to `System.Collections.Generic.List<UnityEngine.Vector2Int>'
- Category
- C#
- Title
- unity custom update
- Category
- C#
- Title
- decalre an int list mvc
- Category
- C#
- Title
- debug.log
- Category
- C#
- Title
- unity array of child objects
- Category
- C#
- Title
- fahrenheit to celsius c#
- Category
- C#
- Title
- how to create a variable in C#
- Category
- C#
- Title
- c# Authorization has been denied for this request
- Category
- C#
- Title
- bold caption latex
- Category
- C#
- Title
- unity how to rotate something to point to something else
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- datatable return column names
- Category
- C#
- Title
- c# LCP
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- zip file ignoring directory starting with dot
- Category
- C#
- Title
- snake game
- Category
- C#
- Title
- c# how to exit program
- Category
- C#
- Title
- mouseposition unity
- Category
- C#
- Title
- .net core check if linux
- Category
- C#
- Title
- how to populate listbox using list<t> c#
- Category
- C#
- Title
- how to pause physics in unity c#
- Category
- C#
- Title
- c# sql duplicate key exception
- Category
- C#
- Title
- response redirect new tab
- Category
- C#
- Title
- devexpress objectspace to session
- Category
- C#
- Title
- C# sprint key
- Category
- C#
- Title
- check which activity in focus in android
- Category
- C#
- Title
- iframe set html content c#
- Category
- C#
- Title
- c# linq to get most recent item from IList
- Category
- C#
- Title
- f string C#
- Category
- C#
- Title
- drag object unity 2d
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- c# date
- Category
- C#
- Title
- C# .net core convert int to enum
- Category
- C#
- Title
- csharp datetime string format
- Category
- C#
- Title
- c# download string url
- Category
- C#
- Title
- array syntax c#
- Category
- C#
- Title
- check if network is available c#
- Category
- C#
- Title
- round vector3 unity
- Category
- C#
- Title
- mvc write to console
- Category
- C#
- Title
- c# form set auto scale
- Category
- C#
- Title
- c# new list object
- Category
- C#
- Title
- x angle oes back after 90 unity
- Category
- C#
- Title
- convert system.byte a string c#
- Category
- C#
- Title
- unity get max occurrence in list
- Category
- C#
- Title
- unity c# foreach
- Category
- C#
- Title
- wpf binding object get value
- Category
- C#
- Title
- how to compare datetime in c#
- Category
- C#
- Title
- how to print statement in c#
- Category
- C#
- Title
- get all child gameObject of gameObject C#
- Category
- C#
- Title
- c# how to compare 2 dates without time
- Category
- C#
- Title
- get setter c# model
- Category
- C#
- Title
- eventos c#
- Category
- C#
- Title
- c# double value with 2 decimal places
- Category
- C#
- Title
- void Update
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- c# verify in class exist in list
- Category
- C#
- Title
- C# downloadstirng download old
- Category
- C#
- Title
- get user directory of file in c#
- Category
- C#
- Title
- c# string array to string
- Category
- C#