# SQL SERVER data source venet handler

**URL:** <https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243>\
**Category:** Blazor Server\
**Created:** [July 14, 2020, 9:42am UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243 "2020-07-14T09:42:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 9:42am UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/1 "2020-07-14T09:42:39Z")

</div>

Sience this application is presented as a low code app., please advise me why when I tried to create an "on click event" i get the error  
"dotnet: Pages\AddExportInboundCommand.razor.designer.cs(161,21): error CS0246: The type or namespace name 'UspInboundExportCalculation' could not be found (are you missing a using directive or an assembly reference?) [D:\MyProjects\test\server\BcrsfWebApp.csproj]"  
Where should I set the directive or the assembly reference?

 ![image](https://forum.radzen.com/uploads/default/original/2X/5/52be0a477511cec104e2066131425b24ab6dbb47.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 14, 2020, 10:05am UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/2 "2020-07-14T10:05:04Z")

</div>

I'm not sure I understand what exactly you are doing however you might need to use UspInboundExportCalculation type with full name including namespace. Check where this type is declared.

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 12:56pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/3 "2020-07-14T12:56:52Z")

</div>

Hello Enchev  
I have a store procedure in data base. This was translated by Radzen like in the picture below. I want to acces this method by clicking a button. Can you tell me whar fields to chose from the event handler( none of the information from the documentation is suitable. I get errors like "could not be found (are you missing a using directive or an assembly reference?) "

 ![image](https://forum.radzen.com/uploads/default/original/2X/5/5beb6c59e9604ecf8bab78895734b436157203c9.png)

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 12:57pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/4 "2020-07-14T12:57:44Z")

</div>

I want that store procedure to be executed by clicking a button

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 14, 2020, 1:05pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/5 "2020-07-14T13:05:21Z")

</div>

> [@enchev](#):
>
> UspInboundExportCalculation

What is this type then? The stored procedure from your screenshot does not return such value.

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 1:09pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/6 "2020-07-14T13:09:48Z")

</div>

It does, this is the whole code  
public async Task UspInboundExportCalculations(string ExportInboundCommandid)  
{  
OnUspInboundExportCalculationsDefaultParams(ref ExportInboundCommandid);

```
      SqlParameter[] @params =
      {
          new SqlParameter("@returnVal", SqlDbType.Int) {Direction = ParameterDirection.Output},
          new SqlParameter("@ExportInboundCommandid", SqlDbType.UniqueIdentifier) { Direction = ParameterDirection.Input, Value = new Guid(ExportInboundCommandid)},
      };
      context.Database.ExecuteSqlRaw("EXEC @returnVal=[WebApp].[usp_InboundExportCalculation] @ExportInboundCommandid", @params);

      int result = Convert.ToInt32(@params[0].Value);

      OnUspInboundExportCalculationsInvoke(ref result);

      return await Task.FromResult(result);
  }
```

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 14, 2020, 1:12pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/7 "2020-07-14T13:12:35Z")

</div>

Again, this procedure returns an int value if the execution is successful or not

> [@Irina\_Sercaianu](#):
>
> `int result = Convert.ToInt32(@params[0].Value);`

> [@Irina\_Sercaianu](#):
>
> `return await Task.FromResult(result);`

This is the procedure method name

> [@Irina\_Sercaianu](#):
>
> UspInboundExportCalculations

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 1:20pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/8 "2020-07-14T13:20:39Z")

</div>

Ok, but how can I invoke it and what should I put to Then event?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 14, 2020, 1:22pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/9 "2020-07-14T13:22:21Z")

</div>

This procedure does not return any value that can be used by Then action of the event. You can just execute it.

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 1:25pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/10 "2020-07-14T13:25:19Z")

</div>

So I chose Execute C#  
and at code what should I write?

 ![image](https://forum.radzen.com/uploads/default/original/2X/1/1c204bae40eb2b643732d1f5daa5ab4f99903d51.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 14, 2020, 1:26pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/11 "2020-07-14T13:26:27Z")

</div>

By execute I mean **Invoke Data Source Method** action not Execute action.

---

<div class="post-metadata">

**Author:** ![Irina\_Sercaianu](https://forum.radzen.com/user_avatar/forum.radzen.com/irina_sercaianu/32/3770_2.png) [@Irina\_Sercaianu](https://forum.radzen.com/u/Irina_Sercaianu)\
**Post date:** [July 14, 2020, 1:49pm UTC](https://forum.radzen.com/t/sql-server-data-source-venet-handler/4243/12 "2020-07-14T13:49:41Z")

</div>

Just like this?  
Without Then?

 ![image](https://forum.radzen.com/uploads/default/original/2X/8/8ecbe33194e41d0993aa0a1dda65e7c2c2ecdf56.png)
