Knowledge Base Category: Development

How to find a String in a Store Procedure?

The following code finds a string thru all store procedures
[tp no_translate="y"]
select from sys.procedures p join 
syscomments c ON
where text like '%TABLENAME%'
To search for a column name in a table use the following:
 Select as tablename,c.* from sys.columns c 
 Join sys.tables t on c.object_id=t.object_id
 where = 'Note'
[/tp]  ...
Read more

How to get records from SQL to a label, textbox, or a datatable?

Make sure you import: [tp no_translate="y"]
Imports System.Data
Imports System.Data.SqlClient
For C#:
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
to get one record FROM PROCEDURE
[expand title="see code"] [tp no_translate="y"]
Public Function gettotal(ByVal VARIABLE As Int32) As Decimal
        Dim Total... 						
Read more

How to upload a file, save its Filename

Create a form, add a button upload and a fileupload add a datasource with insert script. Code Behind: [tp no_translate="y"]
Protected Sub Buttonupload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Buttonupload.Click
Dim str As String

str = FileUploadcontrol.FileName.ToString()
FileUploadcontrol.SaveAs("FolderLocation" & str.ToString)


SqlDataSourcecontrol.InsertParameters("Categoryid").DefaultValue = DropDownListcategory.SelectedValue
SqlDataSourcecontrol.InsertParameters("Question").DefaultValue = TextBox1.Text
SqlDataSourcecontrol.InsertParameters("filename").DefaultValue = str.ToString
TextBoxQuestion.Text = ""
End Sub

Read more

Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /homepages/35/d428352912/htdocs/WilliamMendoza/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048