Salakhosh
❔ if I create Var p=new dynamicParameter() and p.add(“@X”,null) would it give me an error?
Help please as there is a bug where X is not null the API get connected to database and retrieve data while in null part it doesn’t (keep in mind that I handled null in sql )
3 replies
❔ can someone please help me make a 4 day road map before my internship starts?
Hello, so I landed this internship where the current goal is to build a system using WPF. I had a task before hand and I was able to do it ( it was to write a system where you import excel file and display it to WPF and then save it to database)[ I googled a lot but understood what I was writing ]. Recruiter knows that I have no knowledge in C# and I want to leave a good impression from beginning. Can someone please help me what should I study? We are using WPF with MVVM and Team foundation system. Thanks in advance
16 replies
❔ fastest way to add a datatable to database
Hello, so I was doing a task and my final step was adding a datatable to a database. I did connections and everything and I for loop over every element in data table and added it to database.( I never worked with C# so I don’t really know much about its classes) .Recruiter told me there is a faster way. Can someone please help me with code ? (assume I have DataTable dataTable with all the data and I want to import it into database with features (EmployeeID, Name,Date)
10 replies
Does anyone know how to import datatable into an SQL Server?
I have this task to import excel file to grid control and what i did was use oledb to parse excel file to datatable and then bind it to GridControl. How can i then import this datatable to an sql server? thanks in advance
2 replies
How can i import excel file to dataTable using C#(WPF application) and oledb.
Hello so i have task where i have to browse an excel file and import its data to a data table but when im using oledb and reach query part it give me that Sheet1 doesnt exist and honestly idk what should i write. This is what i reached so far private void Browse_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|xlsx,xls";
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
PathBox.Text = ofd.FileName;
string path = ofd.FileName;
string connectionString = $"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path};Extended Properties='Excel 12.0 Xml;HDR=YES;'";
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
connection.Open();
DataTable dataTable = new DataTable();
// Assuming the data is in the first worksheet
string query = "SELECT * FROM [Sheet1$]";
using (OleDbDataAdapter adapter = new OleDbDataAdapter(query, connection))
{
adapter.Fill(dataTable);
}
connection.Close();
}
}
1 replies