Esempio n. 1
0
        public static DataTable GetParameters(string SPname, string DBstring)
        {
            GenesisDataSetTableAdapters.CodeReplicator_GetParametersTableAdapter TA = new GenesisDataSetTableAdapters.CodeReplicator_GetParametersTableAdapter();
            GenesisDataSet.CodeReplicator_GetParametersDataTable DT = new GenesisDataSet.CodeReplicator_GetParametersDataTable();
            //Choose the database (with the connection string provided in form1
            System.Data.SqlClient.SqlConnection SQLCONN = TA.Connection;
            TableAdapterManager.ChangeConnection(ref SQLCONN, DBstring);

            TA.Fill(DT, SPname);

            if (DT != null && DT.Rows.Count > 0)
            {
                DataTable AuxTable = new DataTable("Params");
                AuxTable.Columns.Add("Type", typeof(String));
                AuxTable.Columns.Add("Name", typeof(String));
                AuxTable.Columns.Add("Length", typeof(int));

                foreach (DataRow row in DT)
                {
                    string varTypeValue = row[0].ToString();
                    varTypeValue = varTypeValue.Substring(1);

                    row[0] = varTypeValue;
                    AuxTable.Rows.Add(row.ItemArray);
                }
                return(AuxTable);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public static DataTable GetTableInfo(string TableName, string DBstring)
        {
            GenesisDataSetTableAdapters.CodeReplicator_GetTableInfoTableAdapter TA = new GenesisDataSetTableAdapters.CodeReplicator_GetTableInfoTableAdapter();
            GenesisDataSet.CodeReplicator_GetTableInfoDataTable DT = new GenesisDataSet.CodeReplicator_GetTableInfoDataTable();
            //Choose the database (with the connection string provided in form1
            System.Data.SqlClient.SqlConnection SQLCONN = TA.Connection;
            TableAdapterManager.ChangeConnection(ref SQLCONN, DBstring);

            TA.Fill(DT, TableName);

            if (DT != null && DT.Rows.Count > 0)
            {
                return(DT);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        public static List <string> GetSPNames(string DBstring)
        {
            GenesisDataSetTableAdapters.CodeReplicator_GetSPsTableAdapter TA = new GenesisDataSetTableAdapters.CodeReplicator_GetSPsTableAdapter();
            GenesisDataSet.CodeReplicator_GetSPsDataTable DT = new GenesisDataSet.CodeReplicator_GetSPsDataTable();
            //Choose the database (with the connection string provided in form1
            System.Data.SqlClient.SqlConnection SQLCONN = TA.Connection;
            TableAdapterManager.ChangeConnection(ref SQLCONN, DBstring);

            TA.Fill(DT);

            if (DT != null && DT.Rows.Count > 0)
            {
                List <string> aux = new List <string>();
                foreach (DataRow row in DT)
                {
                    aux.Add(row[0].ToString());
                }
                return(aux);
            }
            else
            {
                return(null);
            }
        }