小编Vij*_*dra的帖子

什么是数据表示控件的ItemCommand和ItemDatabound?

请使用数据表示控件的示例ItemCommand和ItemDatabound进行说明.

c# asp.net repeater

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

在SQL Server中拆分组中的输出行

我必须平均划分行,所以在这里,例如,有15行.我想平均划分,这是三组,但我希望名称只出现在每组的第一个条目之前,如图所示:

DECLARE @NAMES TABLE
(
[ID] INT IDENTITY,
[NAME] VARCHAR(20)
)


INSERT INTO @NAMES
SELECT 'NAME1' UNION ALL
SELECT 'NAME2' UNION ALL
SELECT 'NAME3' UNION ALL
SELECT 'NAME4' UNION ALL
SELECT 'NAME5' UNION ALL
SELECT 'NAME6' UNION ALL
SELECT 'NAME7' UNION ALL
SELECT 'NAME8' UNION ALL
SELECT 'NAME9' UNION ALL
SELECT 'NAME10' UNION ALL
SELECT 'NAME11' UNION ALL
SELECT 'NAME12' UNION ALL
SELECT 'NAME13' UNION ALL
SELECT 'NAME14' UNION ALL
SELECT 'NAME15' 
Run Code Online (Sandbox Code Playgroud)

期望的输出:

ID          NAME
----------- --------------------
1           NAME1
2 …
Run Code Online (Sandbox Code Playgroud)

sql sql-server

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

将实施哪个界面?

我有关于Interface的问题.有2个接口都包含相同的Method Test().现在我继承了Sample类中的接口.我想知道将调用哪个接口的方法?我的代码示例如下:

interface IA 
{
    void Test();
}
interface IB
{
    void Test();
}
class Sample: IA, IB
{
    public void Test()
    {
      Console.WriteLine("Which interface will be implemented IA or IB???!");
    }
}
class Program
{
    public static void Main(string[] args)
    {
        Sample t = new Sample();
        t.Test();//Which Interface's Method will called.
        Console.ReadLine();
    }
}
Run Code Online (Sandbox Code Playgroud)

谢谢Vijendra Singh

c# inheritance interface

2
推荐指数
2
解决办法
273
查看次数

C#引用类型行为

我对引用类型有些困惑以下是测试示例请告诉我它是如何工作的

class TestClass
{
    public int i = 100;
}

class MyTestClass
{
    public void Method()
    {
        int i = 200;
        var testClass = new TestClass();
        testClass.i = 300;
        Another(testClass, i);
        Console.WriteLine("Method 1:" + testClass.i);
        Console.WriteLine("Method 2:" + i);
    }
    public void Another(TestClass testClass, int i)
    {
        i = 400;
        testClass.i = 500;
        testClass = new TestClass();
        //If we have set here again testClass.i = 600; what should be out putin this case
        Console.WriteLine("Another 1:" + testClass.i);
        Console.WriteLine("Another 2:" + …
Run Code Online (Sandbox Code Playgroud)

c# asp.net

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

标签 统计

c# ×3

asp.net ×2

inheritance ×1

interface ×1

repeater ×1

sql ×1

sql-server ×1