|
I need proffesionaly "ADO.net Databaseconnection string" Coding Part.how to storing the Datas and retrieving in Database
thanking you,
somasundaram,
|
|
|
|
|
I have a datatable which I would like to be able to set
properties for each column to display as a gridview. I
am creating a boundfield or checkboxfield etc.. for
each column. These fields are set to have have there
datafields from the datatable. Trouble is when i bind
the datatable to the gridview I end up with boundfield
version of the column and the original.
How can I only show the boundfields or whatever?
Hope this makes sense. I am still very new to asp.net
I will include my code incase it helps.
Public Function buildGrid(ByVal DS As DataSet, ByVal ChartDetails As DataTable, ByVal GridID As Integer, ByVal TableId As Integer) As GridView
Dim Grid As New GridView
Dim oTemp As Object
Dim oboundCol As BoundField
'Declare and fill dataview
Dim dv As DataView
dv = New DataView
dv.Table = ChartDetails
Dim ColumnID As Integer
Dim DataGrid As New DataTable
DataGrid = DS.Tables(TableId - 1).Copy
dv.Sort = "ColumnID ASC"
Dim ods As New ObjectDataSource
Dim ColCount As Integer = 0
While ColCount < DataGrid.Columns.Count
ColumnID = ColCount + 1
dv.RowFilter = "ColumnID = '" & ColumnID & "' AND GridID = '" & GridID & "'"
dv.RowStateFilter = DataViewRowState.CurrentRows
oboundCol = New BoundField
If dv.Count > 0 Then
oboundCol.DataField = DataGrid.Columns(ColCount).ColumnName.ToString
oTemp = New Object
oTemp = oboundCol
oTemp.HeaderText = dv.Item(0).Row.Item("Name")
oTemp.ItemStyle.HorizontalAlign = HorizontalAlign.Left
Else
oboundCol.DataField = DataGrid.Columns(ColCount).ColumnName.ToString
oTemp = oboundCol
End If
Grid.Columns.Add(oTemp)
ColCount = ColCount + 1
End While
Grid.DataSource = DataGrid
Grid.DataBind()
Return Grid
End Function
|
|
|
|
|
I am confused!
I went through the process of creating a query, using the "Build a Program Now!" book - step-by-step and it appeared to be accepted. However, it produced a NULL result, even though the data is there with the sessionID number or two that I tested.
My code:
SELECT wsName 'a String<br />
FROM WordSurvey 'the Table Name<br />
WHERE (sessionID=@sessionID) 'Int32 number<br />
I also get a warning:
"The new command text returns data with schema different from the schema of the main query. Check your query's command test if this is not desired."
And the SQL icon in the TableAdapter is not ticked like the "normal" one above it.
Why I am confused is that I loaded the "BAPN!" solution and tried generating a similar Select - and it worked fine!
I can only conclude that I am following the right process but there must be something wrong with the Table set-up. The Table seems to be OK and data is being accepted. The TableAdapter has been set up to provide the normal basic Fill/Get and that has worked for obtaining output. It is just this new query that is a problem.
Can anyone throw any clues, please?
All help gratefully received!
(VB Exp 2005, SQL Exp 2005)
|
|
|
|
|
Are you connecting to a database which contains a table called WordSurvey ? And are you sure you're passing in a sessionID that is in the table ? I presume the table contains a column called wsName, which contains data ( it could be null )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
Thanks for your response.
Yes: the Table is WordSurvey.
Yes: sessionID column is in the same Table
Yes: wsName column is also in the same Table. Yes, it can be Null.
The test data I have entered is across two sessionID s and in the DataGrid, the above two coumns are there and populated. In fact, I have a Form with a ListBox that correctly lists all wsNames.
I want to list only the wsNames relating to one Session, so that they can be selected and displayed. Hence the SQL Query.
I hope that gives you more clues to assist me!
|
|
|
|
|
What does the VB.NET code look like ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi,
i want to show a splash screen in my vb.net windows project.
a splash screen or welcome screen should come up as the project is loading on running the EXE file.
experienced VB developers might know the solution to this in vb.net
any ideas on how to implement that?
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
There's a component built in, but it's trivial. Create a window with no frame, put your bitmap on it, and show it as the first step in your app, hide it with a timer
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
if you're in debugging window screen of vb.net, click Project from toolbar and select "Add new item" then select Splashscreen...
then right click at your project name (sample) then choose properties, then select the "Application" tab and you will see a "Start Up" chose the splash screen then save...
and then play your application...
you have to set a timer for the splash screen...
nothing is impossible.....
|
|
|
|
|
hi,
i did not your meaning by
"if you're in debugging window screen of vb.net, click Project from toolbar and select "Add new item" then select Splashscreen..."
please elaborate it a little
although i have searched every option avaialble in VisualStudio.Net......but i did not find any option as "Splash screen"
please specify
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
hi ,
creat a new form called splash.vb , add images ,labels to this form
in the load event of the startup form in the project wrtie the following
dim frmSplash as new splash
frmSplash.show
in the end , write this
frmsplash.close
this code show the splash screen until the load proccess is complete , then closed automaticaly
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
hi my task is develop wordart which we can able to sizing and shaping according to mouse moving
|
|
|
|
|
Word art is where the font is all different shapes, right ? You can render a character into a path, which you can then warp.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am trying to get several forms to work together. I have all my forms added and as long as only my first form has references to other forms I don't get an error, but as soon as I make other forms reference each other, i get an error and it wont run at all. Here is the coding I have so far for the forms. (each form as a single project runs fine)
(game.vb)(also listed as my start object in my project properties)
Module game
Sub Main()
Dim form1 As New form1
Dim code As New code
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
form1.ShowDialog()
code.ShowDialog()
decode.ShowDialog()
math.ShowDialog()
piglatin.ShowDialog()
End Sub
End Module
(form1)(this is my starting form and does work as long as other forms dont have any form references)
Dim code As New code
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
code.Close()
decode.Close()
math.Close()
piglatin.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If optCode.Checked = True Then
Me.Visible = False
code.Visible = True
decode.Visible = False
math.Visible = False
piglatin.Visible = False
ElseIf optDecode.Checked = True Then
Me.Visible = False
code.Visible = False
decode.Visible = True
math.Visible = False
piglatin.Visible = False
ElseIf optMath.Visible = True Then
Me.Visible = False
code.Visible = False
decode.Visible = False
math.Visible = True
piglatin.Visible = False
ElseIf optPiglatin.Visible = True Then
Me.Visible = False
code.Visible = False
decode.Visible = False
math.Visible = False
piglatin.Visible = True
End If
End Sub
End Class
(code)(this is the second form in my list, moment i had references to the first form, it all stops working)
(global varables)
Dim form1 As New form1
Dim decode As New decode
Dim math As New math
Dim piglatin As New piglatin
(this is my exit button)
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
form1.Close()
decode.Close()
math.Close()
piglatin.Close()
End Sub
(this is my back button which should return to the menu(form1))
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.Visible = False
form1.Visible = True
End Sub
This is all the code that I have that concerns any joining of forms. I seriously don't know what I am doing wrong on this.
oh, the error I am getting when I have the code uncommented on my form-code is:
An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll (this is on the messagebox that pops up.)
The highlighted text that appears is:
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New() (this is the highlighted line of code)
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
|
|
|
|
|
Tretanya wrote: 'System.StackOverflowException'
This means your forms are calling each other over and over, until you run out of stack space
Instead of making your classes so tightly coupled, you should use delegates to define communication between forms.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Could you give an example of what your meaning? I am not sure what you are meaning of using delegates.
Thanks for your quick reply
|
|
|
|
|
Do you know what a delegate is ? Have you tried using google to find out ?
A delegate is a variable which represents a function definition. It can be assigned to any function that fits the definition, which means that one form can define a method used to pass data as a delegate, and an instance of that delegate, and another form can define the function that the instance is assigned to. So, form1 can call a method which is within form2, and pass any data it likes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi,
anyone know how to search the date by "dd/mm/yyyy" in sql query!
my code is :
Select datamonth from datemonthtest where datamonth >= #" & strdatefrom & "# and datamonth <=#" & strdateto "#
and data type i set it to date/time!
The result is not efficient to select the month!
Example: when i select the date is from 01/10/2006 to date 30/10/2006 but all the previous month will be come out! 09/08/2006......
Please help!
|
|
|
|
|
I thnk DATEPART is what you need, perhaps.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Most likely due to the date format that you are using. The database is probably expecting the format "MM/dd/yyyy".
You should use an unambigous date format like ISO 8601 ("yyyy-MM-dd"), or better yet, parameterised queries.
---
b { font-weight: normal; }
|
|
|
|
|
use "yyyy-MM-dd" + " 00:00:00 Between "yyyy-MM-dd" + " 23:59:59 "
Format
Ravikumar
[Coimbatore]
|
|
|
|
|
This is a piece of code you can use to convert data:
SET DATEFORMAT dmy
DECLARE @datevar datetime
SET @datevar = '31/12/1998'
SELECT @datevar
And the result are:
1998-12-31 00:00:00.000
Hope this helps!
-- modified at 9:07 Wednesday 6th December, 2006
|
|
|
|
|
good day everyone, once again i need your help...("i do always need your help...")
how to clear textbox control?
i only do this manually like this : textbox1.text = ""
my problem is, if i will have 10 more textbox in my form it will consume more time to do the same thing...
anyone can help me, how to solve my problem of difficulties?....
i know its to simple for you guys... pls i need your help once again... thank you...
Special Thanks to Sir Chris.. for giving your ideas...
nothing is impossible.....
|
|
|
|
|
momooomooomomo wrote: my problem is, if i will have 10 more textbox in my form it will consume more time to do the same thing...
It doesn't take that long, just change the TextBox value.
|
|
|
|
|
thats good and i appreciat your effort... but my problem is how to code on how to clear textbox without knowing that you have 10 or more textbox in a form?... that idea is great but i need more technical answer coz i already done this one textbox1.text = ""...
nothing is impossible.....
|
|
|
|