| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.Data;
|
|---|
| 3 | using System.Data.SqlClient;
|
|---|
| 4 | using System.Collections.Generic;
|
|---|
| 5 | using System.Text;
|
|---|
| 6 |
|
|---|
| 7 | namespace ExportFaktur
|
|---|
| 8 | {
|
|---|
| 9 | class DBUtils
|
|---|
| 10 | {
|
|---|
| 11 | public static object ExecuteScalarQuery(string query)
|
|---|
| 12 | {
|
|---|
| 13 | SqlConnection conn = new SqlConnection(ConnString.getConnString().CdnExpoConnStr);
|
|---|
| 14 |
|
|---|
| 15 | SqlCommand command = new SqlCommand(query);
|
|---|
| 16 | command.Connection = conn;
|
|---|
| 17 |
|
|---|
| 18 | object result = null;
|
|---|
| 19 |
|
|---|
| 20 | conn.Open();
|
|---|
| 21 | result = command.ExecuteScalar();
|
|---|
| 22 | conn.Close();
|
|---|
| 23 |
|
|---|
| 24 | return result;
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
Notatka: Zobacz
TracBrowser
aby uzyskać więcej informacji.