Salakhosh
My static String in library project becomes null when i enter a controller in API project
Hello so i have two projects. A library project(where you define models and call API Controllers) and API project. In library project , i defined a static class with static string and string is not null. but i am having a problem when i call a controller this string becomes null and when i exit the controller , it returns to its ordinary value. Does someone know how or why? Thanks in advance
13 replies
If i want to Convert ImageSource to byte[], is it possible to know max dimensions it can take?
So i am working on a wpf application and when i pick an image it gets converted to byte[] as editvalue. However when we uploaded 3000x4000 dimension photo the system couldnt take it and after debugging i found out it is because of the conversion so is there any way i can know what is max dimensions a byte[] can take ? Thanks in advance
3 replies
❔ 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