小编Koo*_*ler的帖子

BindingSource刷新

我有2个类ie CustomerOrder,Customer类有一个订单集合的引用.我使用主细节BindingSources.

我的问题是当我使用延迟加载模式的订单时,我的细节BindingSource没有更新.

UI

BindingSource1.datasource = GetCustomers();
BindingSource2.DataMember = "Orders";
BindingSource2.datasource = BindingsSource1;
Run Code Online (Sandbox Code Playgroud)

所以在我的datagridView1Click事件中

if (customer.orders != null)
{
  customer.Orders = LoadOrders();
}
Run Code Online (Sandbox Code Playgroud)

我很感激任何帮助.

.net c# business-objects bindingsource winforms

3
推荐指数
1
解决办法
2万
查看次数

使用C#连接到Mysql数据库 - 需要一些数据集

编辑

我显然不明白如何做到这一点.在提供示例之后,我决定更多地阅读书籍,并尝试使用给出的示例来解决这些问题.

谢谢.

编辑结束

我想连接到mySql DB,读取表/行,然后将它们写入控制台.这段代码是否正确?我在Visual Studio 2005中得到数据集错误.

代码不是我的,从网上获取.我只是修改了一下(变量名等).

如果您有一个很好的教程,请发布链接.=)

/* Performing a SELECT statement using ADO.NET */
#region Using directives

using System;
using System.Data;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;

#endregion

namespace testConnect1
{
    class SqlTest1
    {
        static void Main()
        {
            string connectionString = "server = localhost user id = root  Password = blank  database = test1"; //connection string


            SqlConnection mySqlConnection = new SqlConnection(connectionString);  //creates connection

            string selectString = "Select field01, field02, field03 " + "FROM myDataTable";  //selects fields to be …
Run Code Online (Sandbox Code Playgroud)

c# mysql dataset

3
推荐指数
1
解决办法
3万
查看次数

从saveFileDialog获取没有文件名的路径?

我试图从SaveFileDialog我的文件名中获取我的路径以创建一个DirectoryInfo对象

private void btnBrowseCapture_Click(object sender, EventArgs e)
{
    SaveFileDialog saveFileDialogBrowse2 = new SaveFileDialog();
    saveFileDialogBrowse2.Filter = "Pcap file|*.pcap";
    saveFileDialogBrowse2.Title = "Save an pcap File";
    saveFileDialogBrowse2.ShowDialog();

    if (saveFileDialogBrowse2.FileName != "")
    {
        string str = saveFileDialogBrowse2.FileName;

    }
}
Run Code Online (Sandbox Code Playgroud)

c# winforms

3
推荐指数
1
解决办法
2万
查看次数

CKSubscriptions 和生产容器

嗨,我正在尝试创建一个 CKSubscription,我使用以下代码:

func setupCKSubscriptions(){

    if NSUserDefaults.standardUserDefaults().boolForKey("sub") == false{

    let subscription = CKSubscription(recordType: "Quadri", predicate: NSPredicate(value: true), options: .FiresOnRecordCreation)

    let notificationInfo = CKNotificationInfo()
    notificationInfo.alertLocalizationKey = NSLocalizedString("NEW_Q", comment: "")
    notificationInfo.shouldBadge = true

    subscription.notificationInfo = notificationInfo

    CKContainer.defaultContainer().publicCloudDatabase.saveSubscription(subscription) { (subscription, errore) -> Void in

        if errore == nil{

            NSUserDefaults.standardUserDefaults().setBool(true, forKey: "sub")
            NSUserDefaults.standardUserDefaults().synchronize()
            let alert = UIAlertController(title: "Ok", message: "", preferredStyle: .Alert)
            self.presentViewController(alert, animated: true, completion: nil)

        }else{

            print(errore?.localizedDescription)
            let alert = UIAlertController(title: "Errore", message: errore?.localizedDescription, preferredStyle: .Alert)
            self.presentViewController(alert, animated: true, completion: nil)
        }
    } …
Run Code Online (Sandbox Code Playgroud)

icloud swift

3
推荐指数
1
解决办法
249
查看次数

如何使用Swift上的drawRect更改三角形图的颜色

我做了三角视图,叫做UpTriangleView.它用于显示投票.当他们被轻拍时,我想改变他们的颜色.我想UIColor.grayColor().setStroke()从实例中,但我不知道该怎么做.如果你知道的话,请告诉我怎么做.谢谢你的亲属关系.

class UpTriangleView: UIView {

  override func drawRect(rect: CGRect) {
    self.backgroundColor = UIColor.clearColor()
    // Get Height and Width
    let layerHeight = self.layer.frame.height
    let layerWidth = self.layer.frame.width

    // Create Path
    let line = UIBezierPath()

    // Draw Points
    line.moveToPoint(CGPointMake(0, layerHeight))
    line.addLineToPoint(CGPointMake(layerWidth, layerHeight))
    line.addLineToPoint(CGPointMake(layerWidth/2, 0))
    line.addLineToPoint(CGPointMake(0, layerHeight))
    line.closePath()

    // Apply Color
    UIColor.grayColor().setStroke()
    UIColor.grayColor().setFill()
    line.lineWidth = 3.0
    line.fill()
    line.stroke()

    // Mask to Path
    let shapeLayer = CAShapeLayer()
    shapeLayer.path = line.CGPath
    self.layer.mask = shapeLayer
  }
} 


class QATableViewCell : UITableViewCell{   
  @IBOutlet weak var …
Run Code Online (Sandbox Code Playgroud)

drawrect swift

0
推荐指数
1
解决办法
2034
查看次数

SQL查询"WHERE IN"

我有这个问题:

SELECT Company_Name FROM tblBeneficaries WHERE BeneficaryID IN ()
Run Code Online (Sandbox Code Playgroud)

当我执行它时,它返回消息:

')'附近的语法不正确.

问题是什么?

sql where

0
推荐指数
2
解决办法
1万
查看次数

打包或文件夹与android studio中的文件

我尝试在android中管理文件,但我不知道在执行中将这些文件放在哪里管理.

我可以在哪里使用prueba.html来执行此文件?

我可以在哪里使用prueba.html来执行此文件?

java android file

0
推荐指数
1
解决办法
73
查看次数

如何测试我在特定时间用c#制作的软件?

我在C#中创建了一个应用程序,我想在特定时间测试这个应用程序Day,Week,Year是否有任何空闲时间模拟软件可以做到这一点或任何其他方式?

c# datetime

-2
推荐指数
1
解决办法
71
查看次数