|
If would get this error if you are missing reference to Webresource.axd file.
Create an empty file with name as "Webresource.axd" and copy it to web server wwwroot and your application root folder.
It should work now.
|
|
|
|
|
Hello
i'm new to this site and dont know just yet how to create a new thread.
I'm quite new to visual basic 6 and would like some help designing a program.
-Using visual basic 6 to connect to a Microsoft Access 2000 database
- using a Microsoft ActiveX Data Objects Library
I want to connect a combo box to a databae, for example if the user clicks on the combo box the names of the tables should appear. When the user clicks on the table name its attributes should be displayed in a list box below the combo box.
Can anyone help write the code to accomplish this
Thank you
Here's my attempt to to display the table names in the combo box, this works perfectly fine apart from that it display unnecessary information in the combo such as MSys
Access Objects, MSysACEs,MSysObjects. All i want is thecombo box to display these three tables which are Attainment,Student Module. plus i want the user to select the table name and its attributes are displayed in a list box
[vbcode]Option Explicit
Private Cn As ADODB.Connection ' This is the connection
Private rstSchema As ADODB.Recordset ' This is the recordset
Private strCn As String ' string to be used in the code
Public strSelectedItem As String
Private Sub OpenDB()
Set Cn = New ADODB.Connection 'Declared it as a ADODB connection
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\Documents and Settings\newResults.mdb" 'A connection string that is connected to the database
Cn.Open strCn
End Sub
Private Sub Form_Load()
' retrieve all the information from the database and places it in the combobox
OpenDB
Set rstSchema = Cn.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
cboTables.AddItem " " & rstSchema!TABLE_NAME
rstSchema.MoveNext
Loop
End Sub[/vbcode]
tyrone
|
|
|
|
|
When you want to select all the text in a textbox, you are more likely to use SelectAll function of the textbox in the GotFocus event. Ironically, once this event is fired the text is unselected. The work around is to use a timer and in timer event call SelectAll function.
private void textBox1_GotFocus(object sender, EventArgs e)<br />
{<br />
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();<br />
t.Interval = 10;<br />
t.Tick += new EventHandler(t_Tick);<br />
t.Enabled = true;<br />
}<br />
}<br />
private void t_Tick(object sender, EventArgs e)<br />
{<br />
((System.Windows.Forms.Timer)sender).Enabled = false;
textBox1.SelectAll();<br />
}
Sanjay Sansanwal
www.sansanwal.com
-- modified at 17:52 Tuesday 2nd May, 2006
|
|
|
|
|
The easiest way is to copy html text to clipboard and save to word.
But when you copy an html to clipboard using copy or cut, windows add initial lines which indicates
start and end of HTML, Selection and Fragment. So, to handle this we need to
create text to be copied into compatble to above requirement
The code for this is
Object m = System.Reflection.Missing.Value;<br />
DataObject clipDO = new DataObject();<br />
clipDO.SetData(DataFormats.Html, HtmlClipboardData(strHTML));<br />
Clipboard.SetDataObject(clipDO, true);
<br />
object typeHtml = (object)Word.WdPasteDataType.wdPasteHTML;<br />
s.PasteSpecial(ref m, ref m, ref m, ref m, ref typeHtml, ref m, ref m);
Now, convert normal html text to clipboard one.
///
/// Convert to proper html like
/// Version:1.0
///StartHTML:000000137
///EndHTML:000000204
///StartFragment:000000149
///EndFragment:000000180
///StartSelection:000000149
////EndSelection:000000180
///
///
///File
///
///
///
///
/// <param name="html" />
/// <returns>
private static string HtmlClipboardData(string html)<br />
{<br />
StringBuilder sb = new StringBuilder();<br />
Encoding encoding = Encoding.UTF8;<br />
string Header = @"<br />
Version: 1.0<br />
StartHTML: {0:000000}<br />
EndHTML: {1:000000}<br />
StartFragment: {2:000000}<br />
EndFragment: {3:000000}<br />
";<br />
string HtmlPrefix = @"<br />
<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN""><br />
<html><br />
<head><br />
<meta http-equiv=Content-Type content=""text/html; charset={0}""><br />
</head><br />
<body><br />
<!--StartFragment--><br />
";<br />
HtmlPrefix = string.Format(HtmlPrefix, encoding.WebName);<br />
<br />
string HtmlSuffix = @"<br />
<!--EndFragment--><br />
</body><br />
</html><br />
";<br />
<br />
int HeaderLength = encoding.GetByteCount(Header);<br />
HeaderLength -= 16;
int PrefixLength = encoding.GetByteCount(HtmlPrefix);<br />
int HtmlLength = encoding.GetByteCount(html);<br />
int SuffixLength = encoding.GetByteCount(HtmlSuffix);<br />
<br />
int StartHtml = HeaderLength;<br />
int StartFragment = StartHtml + PrefixLength;<br />
int EndFragment = StartFragment + HtmlLength;<br />
int EndHtml = EndFragment + SuffixLength;<br />
<br />
sb.AppendFormat(Header, StartHtml, EndHtml, StartFragment, EndFragment);<br />
sb.Append(HtmlPrefix);<br />
sb.Append(html);<br />
sb.Append(HtmlSuffix);<br />
<br />
return sb.ToString();<br />
} #endregion
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Issue: The controls added to a web control library don't preserve their state on postback.
Solution: To Make post back work for web control library , implement INamingContainer interface.
E.g:
[DefaultProperty("Date"),
ToolboxData("<{0}:DateTimePicker runat=server>")]
public class DateTimePicker : System.Web.UI.WebControls.WebControl, INamingContainer
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|