oke
oke
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
i did, but i still dont know what to do ive never dealt with services before and i dont know how to use that with dsharpplus
13 replies
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
i dont know what that means
13 replies
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Timed out waiting for the entry point to build the IHost after 00:05:00. This timeout can be modified using the 'DOTNET_HOST_FACTORY_RESOLVER_DEFAULT_TIMEOUT_IN_SECONDS' environment variable.
Unable to create a 'DbContext' of type 'LloydWarningSystem.Net.Entities.LloydContext'. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[LloydWarningSystem.Net.Entities.LloydContext]' while attempting to activate 'LloydWarningSystem.Net.Entities.LloydContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Timed out waiting for the entry point to build the IHost after 00:05:00. This timeout can be modified using the 'DOTNET_HOST_FACTORY_RESOLVER_DEFAULT_TIMEOUT_IN_SECONDS' environment variable.
Unable to create a 'DbContext' of type 'LloydWarningSystem.Net.Entities.LloydContext'. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[LloydWarningSystem.Net.Entities.LloydContext]' while attempting to activate 'LloydWarningSystem.Net.Entities.LloydContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
13 replies
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
right as i said that, it threw an exception
13 replies
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
i removed all packages related to EF6, and now it's just running my bot and doing nothing within the package manager console. It's been open for ~5 minutes.
13 replies
CC#
Created by oke on 7/21/2024 in #help
Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
This is how I start the service (According to what I found with the DSharpPlus documentation
var builder = DiscordClientBuilder.CreateDefault(token,
TextCommandProcessor.RequiredIntents
| SlashCommandProcessor.RequiredIntents
| DiscordIntents.MessageContents
| DiscordIntents.GuildMembers)
.ConfigureServices((services) =>
{
services.AddDbContext<LloydContext>(options =>
{
options.UseSqlite(connectionString);
});

Services = services.BuildServiceProvider();
});
var builder = DiscordClientBuilder.CreateDefault(token,
TextCommandProcessor.RequiredIntents
| SlashCommandProcessor.RequiredIntents
| DiscordIntents.MessageContents
| DiscordIntents.GuildMembers)
.ConfigureServices((services) =>
{
services.AddDbContext<LloydContext>(options =>
{
options.UseSqlite(connectionString);
});

Services = services.BuildServiceProvider();
});
I have never done anything like this, so I'm very lost. I tried following tutorials on the DSharpPlus documentation (Even their example bots), but it didn't help too much.
13 replies
CC#
Created by Jason_Bjorn on 7/13/2024 in #help
✅ [AllowedValue] not doing anything
another thing i noticed for this, even if the attribute actually did something, this still wouldnt work as intended because the constructor only takes an array of objects and notes nothing about the last being an error message so it could be rewritten as
public class Foo
{
[AllowedValues("Bill", "Bob")]
public string Name { get; set; }
}
public class Foo
{
[AllowedValues("Bill", "Bob")]
public string Name { get; set; }
}
19 replies
CC#
Created by Jason_Bjorn on 7/13/2024 in #help
✅ [AllowedValue] not doing anything
i think this one is mostly on microsft (or the team of people who update the docs) it would be nice if there were a tag or something that clarified that this does nothing
19 replies
CC#
Created by Vegas on 7/13/2024 in #help
DataGrid Cell Selection / Row Color
can you give more? like the entire method? that, plus what type dataview is, because im led to assume its DataGridView
8 replies
CC#
Created by steven preadly on 7/13/2024 in #help
✅ positional parameters
huh
31 replies
CC#
Created by Vegas on 7/13/2024 in #help
DataGrid Cell Selection / Row Color
im not too sure though someone who has more experience with c# than me might swing by and tear my code apart and better fix your issue
8 replies
CC#
Created by Vegas on 7/13/2024 in #help
DataGrid Cell Selection / Row Color
can you give more context? (a bigger picture of the code) because from what i see, the issue is that a DataGridView doesnt have a member called Cell what is does have is Rows[x].Cells because a DataGridView contains rows and columns, you need to specify the row, then you can select the cell from that so, maybe something like this?
if (dr.Length == 0 || dataview.Rows.Count == 0 || dataview.Rows[0].Cells.Count < 26)
{
// The grid doesn't have enough rows or cells to access data in Row 1 Cell 26
Console.WriteLine("Cell 26 doesn't exist!");
return;
}

// Not sure what 'dr' is
string can = dr[0].ToString();
if (can == "1" && dataview.Rows[0].Cells[26].Value as int? == 1)
{
dataview.RowBackground = Brushes.LightPink;
}
if (dr.Length == 0 || dataview.Rows.Count == 0 || dataview.Rows[0].Cells.Count < 26)
{
// The grid doesn't have enough rows or cells to access data in Row 1 Cell 26
Console.WriteLine("Cell 26 doesn't exist!");
return;
}

// Not sure what 'dr' is
string can = dr[0].ToString();
if (can == "1" && dataview.Rows[0].Cells[26].Value as int? == 1)
{
dataview.RowBackground = Brushes.LightPink;
}
8 replies
CC#
Created by YureshTharushika on 7/8/2024 in #help
Authentication problem in SignalR
$code
7 replies
CC#
Created by YureshTharushika on 7/8/2024 in #help
Authentication problem in SignalR
$paste
7 replies
CC#
Created by antahra on 7/11/2024 in #help
How to retain precision in the Sql Server Table column data type 'float' when using SqlBulkCopy?
float is a 32 bit number, double is 64 bits, and decimal is 128 bits
3 replies
CC#
Created by Boggy on 7/12/2024 in #help
C# event subscription in the context of a gRPC stream
$close
4 replies
CC#
Created by Nacho Man Randy Cabbage on 7/12/2024 in #help
Winforms - cursor doesn't stay as "WaitCursor" in long running async method
try using a Refresh() to force the form to refresh things right after setting the cursor. if i had to guess, its setting the cursor then going to the file without giving the form a chance to change.
4 replies
CC#
Created by Silme94 on 7/12/2024 in #help
Windows Forms Wrong color help
can you refactor your question to be a little clearer? from what im getting something only turns blue when you hover your mouse over it also, why did you use the advanced, intermediate, and beginner tags together?
4 replies
CC#
Created by Jason_Bjorn on 7/13/2024 in #help
✅ [AllowedValue] not doing anything
It just says "specifies a list of values that should be allowed"
19 replies
CC#
Created by Jason_Bjorn on 7/13/2024 in #help
✅ [AllowedValue] not doing anything
19 replies