|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace JocysCom.Sql.ScriptsGenerator.Controls
{
public partial class GenerateActionScripts
{
private void RefreshColumnsTextBox()
{
if (table != null)
{
ColumnsTextBox.Text = GetColumns(table, (int)ColumnsTabIdentNumericUpDown.Value, ColumnsPrefixTextBox.Text);
}
}
private void ColumnsTabIdentNumericUpDown_ValueChanged(object sender, EventArgs e)
{
RefreshColumnsTextBox();
}
private void ColumnsPrefixTextBox_TextChanged(object sender, EventArgs e)
{
RefreshColumnsTextBox();
}
private string GetColumns(Microsoft.SqlServer.Management.Smo.Table table, int ident, string prefix)
{
string tabs = new StringBuilder().Append('\t', ident).ToString();
string text = GetColumnsList(table, ParamListType.All, "");
StringBuilder sb = new StringBuilder();
// Use a StringReader.
System.IO.StringReader reader = new System.IO.StringReader(text);
string line = string.Empty;
// Cycle through while there are lines to read.
while ((line = reader.ReadLine()) != null)
{
// Add the line.
sb.AppendLine(tabs + prefix +line);
}
return sb.ToString();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.